This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Erasmus Cedernaes
Recipients Erasmus Cedernaes
Date 2017-09-27.08:16:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
How to reproduce:
* Run the attached file with Python 2.7 without any modifications. This will produce an error, as described below.
* Uncomment line 2 (the decorator @unittest.expectedFailure) and run the file with Python 2.7. This will not produce an error.

Adding the decorator @unittest.expectedFailure to a unittest.TestCase causes the TestLoader().loadTestsFromTestCase(...) to fail with the following output:

$ python2.7
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "[...]/", line 12, in <module>
    tests = unittest.TestLoader().loadTestsFromTestCase(TestClassThatFails)
  File "/usr/lib/python2.7/unittest/", line 50, in loadTestsFromTestCase
    if issubclass(testCaseClass, suite.TestSuite):
TypeError: issubclass() arg 1 must be a class

The error does only occur when adding the test manually to a test suite. Running unittest.main(), does not produce the error.
Date User Action Args
2017-09-27 08:16:44Erasmus Cedernaessetrecipients: + Erasmus Cedernaes
2017-09-27 08:16:44Erasmus Cedernaessetmessageid: <>
2017-09-27 08:16:44Erasmus Cedernaeslinkissue31604 messages
2017-09-27 08:16:44Erasmus Cedernaescreate