Enable unittest.TestCase to be instantiated without providing a method name.

Changed unittestgui to show number of discovered tests in the status bar.
This commit is contained in:
Michael Foord 2011-01-03 17:00:11 +00:00
parent faa8c13ef4
commit 32e1d8340c
5 changed files with 30 additions and 5 deletions

View file

@ -77,6 +77,16 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
self.assertEqual(Test().id()[-13:], '.Test.runTest')
# test that TestCase can be instantiated with no args
# primarily for use at the interactive interpreter
test = unittest.TestCase()
test.assertEqual(3, 3)
with test.assertRaises(test.failureException):
test.assertEqual(3, 2)
with self.assertRaises(AttributeError):
test.run()
# "class TestCase([methodName])"
# ...
# "Each instance of TestCase will run a single test method: the