ANN: pry unit testing framework

Aldo Cortesi aldo at nullcube.com
Sun Apr 6 22:34:42 EDT 2008


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.

> > 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.

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.




Regards,



Aldo

-- 
Aldo Cortesi
M: +61 419 492 863
P: +61 1300 887 007
W: www.nullcube.com



More information about the Python-list mailing list