nose-devs/nose — Issue #37: test_suite="nose.collector" broken under Python 2.7rc1's unittest
Author: jpellerin
Created: 2011-12-14 15:56:19+00:00
State: open

What steps will reproduce the problem?
1. Place the following setup.py file in a directory, along with a Python
file with some nose tests in it:

from setuptools import setup

setup(name='testdist',
version='0.1',
test_suite='nose.collector',
tests_require=['nose'])

2. Run "python setup.py test"

What is the expected output? What do you see instead?

In Python 2.4-2.6 (at least), the nose tests are run. In Python 2.7rc1,
this:

(py27env)carljm@kale:~/projects/nose/collector27$ python setup.py test
running test
running egg_info
writing testdist.egg-info/PKG-INFO
writing top-level names to testdist.egg-info/top_level.txt
writing dependency_links to testdist.egg-info/dependency_links.txt
reading manifest file 'testdist.egg-info/SOURCES.txt'
writing manifest file 'testdist.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "setup.py", line 6, in
tests_require=['nose'])
File "/opt/python-2.7rc1/lib/python2.7/distutils/core.py", line 152, in
setup
dist.run_commands()
File "/opt/python-2.7rc1/lib/python2.7/distutils/dist.py", line 953, in
run_commands
self.run_command(cmd)
File "/opt/python-2.7rc1/lib/python2.7/distutils/dist.py", line 972, in
run_command
cmd_obj.run()
File "build/bdist.linux-i686/egg/setuptools/command/test.py", line 121,
in run
File "build/bdist.linux-i686/egg/setuptools/command/test.py", line 101,
in with_project_on_sys_path
File "build/bdist.linux-i686/egg/setuptools/command/test.py", line 130,
in run_tests
File "/opt/python-2.7rc1/lib/python2.7/unittest/main.py", line 95, in
__init__
self.runTests()
File "/opt/python-2.7rc1/lib/python2.7/unittest/main.py", line 229, in
runTests
self.result = testRunner.run(self.test)
File "/opt/python-2.7rc1/lib/python2.7/unittest/runner.py", line 151, in
run
test(result)
File "/opt/python-2.7rc1/lib/python2.7/unittest/suite.py", line 65, in
__call__
return self.run(*args, **kwds)
File "/opt/python-2.7rc1/lib/python2.7/unittest/suite.py", line 85, in
run
self._wrapped_run(result)
File "/opt/python-2.7rc1/lib/python2.7/unittest/suite.py", line 97, in
_wrapped_run
if _isnotsuite(test):
File "/opt/python-2.7rc1/lib/python2.7/unittest/suite.py", line 261, in
_isnotsuite
iter(test)
File "/opt/python-2.7rc1/lib/python2.7/unittest/suite.py", line 33, in
__iter__
return iter(self._tests)
AttributeError: 'FinalizingSuiteWrapper' object has no attribute '_tests'

What version of the product are you using? On what operating system?

Tested with nose==dev, on Python 2.7rc1, Ubuntu 9.10.

Please provide any additional information below.

Looks like some internal unittest APIs changed in 2.7, and nose needs to be
updated to match.

Google Code Info:
Issue #: 340
Author: carl.j.meyer
Created On: 2010-06-06T03:32:59.000Z
Closed On: 2010-07-07T16:23:07.000Z