Message225478
My impression is that we are trying to move away from using test_main, or is using support.run_unittest considered a sufficient change from the old explicit suite method?
Anyway, here is an alternate approach, adding two lines to wrap all test classes, that tags the test classes in the code and hence in error messages.
import unittest
for i in range(2): exec('''
class T{0}(unittest.TestCase):
def test_2(self):
self.assertTrue({0} == 1)
'''.format(i))
unittest.main()
>>>
F.
======================================================================
FAIL: test_2 (__main__.T0)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<string>", line 4, in test_2
AssertionError: False is not true
----------------------------------------------------------------------
Ran 2 tests in 0.016s |
|
Date |
User |
Action |
Args |
2014-08-18 00:00:14 | terry.reedy | set | recipients:
+ terry.reedy, gpolo, jesstess, zach.ware, serhiy.storchaka, Lita.Cho |
2014-08-18 00:00:14 | terry.reedy | set | messageid: <1408320014.24.0.263381361741.issue21585@psf.upfronthosting.co.za> |
2014-08-18 00:00:14 | terry.reedy | link | issue21585 messages |
2014-08-18 00:00:14 | terry.reedy | create | |
|