[TIP] Meta-test methods...
C. Titus Brown
ctb at msu.edu
Wed Apr 22 22:14:19 PDT 2009
On Thu, Apr 23, 2009 at 01:08:16AM -0400, Douglas Philips wrote:
-> On 2009 Apr 22, at 3:10 PM, Jesse Noller wrote:
-> > Yes, nose supports test generators. They're the balls.
->
-> UGH. Duplicate code and hacks that make generators special.
-> They're turds.
Huh?
Nose is ugly inside for various good reasons (one being unittest
backwards compatibility, making it compatible with 'python setup.py
test', which is +1 in my book). But, err, it really works quite well.
It's an excellent example of pushing nasty-but-necessary complexity
somewhere else and once you drop the proper LSD it is, as Jesse says,
the balls.
(Jesse, I've been meaning to ask -- is "the balls" *good*??)
Were you pointing at some other code?
Anyway, I double-dare you to make this:
http://github.com/ctb/figleaf/blob/d11d2ee0ce70427b229af15409bff2ab23e090d2/tests/test_regress/__init__.py
work nicely without decorators.
-> I'm now convinced that explicit use of decorators is the right way to
-> go.
...says the man not supporting python2.3 ;)
-> Maybe, just maybe, a naming convention that would parallel the
-> unittest notion of all methods starting with the name 'test' would be
-> acceptable.
I musta missed something. That's exactly what nose (and py.test) do.
-> Really glad I'm not using nose.
Hmmmm...
cheers,
--titus
--
C. Titus Brown, ctb at msu.edu
More information about the testing-in-python
mailing list