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 michael.foord
Recipients michael.foord
Date 2010-04-03.13:32:02
SpamBayes Score 9.044998e-10
Marked as misclassified No
Message-id <1270301524.85.0.299541369901.issue8301@psf.upfronthosting.co.za>
In-reply-to
Content
Putting functions (rather than TestCase instances) directly in TestSuites was never officially supported but it used to work:

>>> from unittest import TestSuite, TestResult
>>> def f(): pass
... 
>>> s = TestSuite()
>>> s.addTest(f)
>>> s.run(TestResult())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/compile/python-trunk/Lib/unittest/suite.py", line 85, in run
    self._wrapped_run(result)
  File "/compile/python-trunk/Lib/unittest/suite.py", line 100, in _wrapped_run
    self._handleClassSetUp(test, result)
  File "/compile/python-trunk/Lib/unittest/suite.py", line 122, in _handleClassSetUp
    currentClass._classSetupFailed = False
TypeError: can't set attributes of built-in/extension type 'function'
History
Date User Action Args
2010-04-03 13:32:04michael.foordsetrecipients: + michael.foord
2010-04-03 13:32:04michael.foordsetmessageid: <1270301524.85.0.299541369901.issue8301@psf.upfronthosting.co.za>
2010-04-03 13:32:03michael.foordlinkissue8301 messages
2010-04-03 13:32:02michael.foordcreate