[TIP] testing the creation of infrastructure
heckj at mac.com
Tue Aug 30 23:11:09 PDT 2011
Thanks Mark -
The first I didn't realize, and that's darned helpful... I'd gotten into the habit of just letting Nose discover my tests and go from there - didn't realize that it preserved order when you handed it a specific file to go chew on.
On Aug 30, 2011, at 11:22 AM, Mark Sienkiewicz wrote:
> Well, that message sure got mangled on the way out. Let's try again:
> - It is fairly trivial to use a unittest2 assertion without using the rest of unittest:
> import unittest2
> class dummy_ut2( unittest2.TestCase ) : # not named test_something
> __test__ = False # just in case
> def runTest( wtf ) :
> raise Exception('Should never be called')
> xcmp = dummy_ut2()
> def test_a() :
> xcmp.assertAlmostEqual( 1.001, 1.002, places=4 )
> IMHO, it would be easy to bury all that in a library if you wanted to.
> Mark S.
More information about the testing-in-python