mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
faa8c13ef4
commit
32e1d8340c
5 changed files with 30 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue