[issue19647] unittest.TestSuite consumes tests

Stefan Holek report at bugs.python.org
Mon Nov 18 22:35:56 CET 2013


New submission from Stefan Holek:

This test passed in Python <= 3.3 but fails in 3.4:

    def testTestSuiteConsumesTest(self):
        class MyTestCase(unittest.TestCase):
            def testMethod(self):
                pass
        test = MyTestCase('testMethod')
        suite = unittest.TestSuite((test,))
        result = unittest.TestResult()
        self.assertEqual(next(iter(suite)), test)
        suite.run(result)
        self.assertEqual(next(iter(suite)), test)

The suite contains None after it has been run in Python 3.4.

----------
components: Library (Lib)
messages: 203325
nosy: stefanholek
priority: normal
severity: normal
status: open
title: unittest.TestSuite consumes tests
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19647>
_______________________________________


More information about the Python-bugs-list mailing list