New submission from Michael Foord <mich...@voidspace.org.uk>:

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'

----------
assignee: michael.foord
components: Library (Lib)
messages: 102259
nosy: michael.foord
severity: normal
stage: needs patch
status: open
title: Putting a function in a unittest.TestSuite doesn't work
type: behavior
versions: Python 2.7, Python 3.2

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

Reply via email to