ANN: pry unit testing framework

Steve Holden steve at holdenweb.com
Sun Apr 6 22:43:39 EDT 2008


Aldo Cortesi wrote:
> Thus spake Ben Finney (bignose+hates-spam at benfinney.id.au):
> 
>>> I'm afraid that Pry is unashamedly incompatible with any other unit
>>> testing method in existence, including but not limited to doctest,
>>> unittest, nose and py.test. ;)
>> Which makes the deliberate deviations from PEP 8 naming a large black
>> mark against it.
> 
> You're misunderstanding the intent of PEP 8, which was never supposed
> to dogmatically enforce a naming standard on all Python projects
> everywhere. You're also vastly overstating the impact of a minor naming
> convention choice. Calling this a "large black mark" smacks of
> scare-mongering to me.
> 
It probably reflects personal preference, but it's a preference that 
many people will maintain. I understand that PEP 008 was largely 
directed at standard library authors and maintainers, but anything that 
claims wide utility should have ambitions to be included in the standard 
library, and hence PEP 008 conformance would be a plus.

>>> Some day I might experiment with extending Pry to gather and run
>>> doctests and unittests. At this stage, however, I don't believe the
>>> (significant) effort would be worth it.
>> That's very unfortunate. Until it plays better with others, I don't
>> believe the effort of using this package will be worth it.
> 
> Each of the third-party testing frameworks that have cropped up in this
> thread extends unittest in some incompatible way. If you use any of
> these extensions, it means that your unit test suite is tied to that
> particular test framework. If you have an existing suite of unit tests
> that you can't or don't want to convert, I'm afraid that Pry is indeed
> not for you. Pry is not intended to be a general engine for running
> tests written for other frameworks.
> 
A reasonable enough point of view, but it means that you are just one of 
a number of competing frameworks. While you are earnest about pry's 
advantages you have a lot of work to do to move people away form the 
entrenched testing frameworks they are used to.

> I should also note that converting from unittest to Pry is quite simple
> - Pry's test structure is a superset of unittest's, and AutoTree was
> explicitly written to make "unittest-style" testing possible, meaning
> that no _structural_ change is needed for conversion. The most onerous
> part is converting to assertion-based testing, something that will
> improve the clarity and readability of your tests anyway.
> 
Time will tell.

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list