Terry J. Reedy added the comment:

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

----------
nosy: +terry.reedy

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21585>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to