Title: unittest: object has no attribute '_removed_tests'
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.4
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, icordasc, wiz
Priority: normal Keywords:

Created on 2015-01-03 19:38 by wiz, last changed 2016-09-28 00:56 by berker.peksag. This issue is now closed.

Messages (3)
msg233365 - (view) Author: Thomas Klausner (wiz) Date: 2015-01-03 19:38
On NetBSD with python-3.4.2 I see the following issue when running the tests for py-flake8-2.2.5:

running build_ext
test_get_parser (flake8.tests.test_engine.TestEngine) ... ok
test_get_python_version (flake8.tests.test_engine.TestEngine) ... ok
test_get_style_guide (flake8.tests.test_engine.TestEngine) ... ok
test_get_style_guide_kwargs (flake8.tests.test_engine.TestEngine) ... ok
test_register_extensions (flake8.tests.test_engine.TestEngine) ... ok
test_stdin_disables_jobs (flake8.tests.test_engine.TestEngine) ... ok
test_windows_disables_jobs (flake8.tests.test_engine.TestEngine) ... ok
Traceback (most recent call last):
  File "", line 74, in <module>
  File "/usr/pkg/lib/python3.4/distutils/", line 148, in setup
  File "/usr/pkg/lib/python3.4/distutils/", line 955, in run_commands
  File "/usr/pkg/lib/python3.4/distutils/", line 974, in run_command
  File "/usr/pkg/lib/python3.4/site-packages/setuptools/command/", line 142, in run
  File "/usr/pkg/lib/python3.4/site-packages/setuptools/command/", line 122, in with_project_on_sys_path
  File "/usr/pkg/lib/python3.4/site-packages/setuptools/command/", line 163, in run_tests
  File "/usr/pkg/lib/python3.4/unittest/", line 93, in __init__
  File "/usr/pkg/lib/python3.4/unittest/", line 244, in runTests
    self.result =
  File "/usr/pkg/lib/python3.4/unittest/", line 168, in run
  File "/usr/pkg/lib/python3.4/unittest/", line 87, in __call__
    return*args, **kwds)
  File "/usr/pkg/lib/python3.4/unittest/", line 130, in run
  File "/usr/pkg/lib/python3.4/unittest/", line 83, in _removeTestAtIndex
    self._removed_tests += test.countTestCases()
  File "/usr/pkg/lib/python3.4/unittest/", line 41, in countTestCases
    cases = self._removed_tests
AttributeError: 'FinalizingSuiteWrapper' object has no attribute '_removed_tests'
*** Error code 1

I have reported this

and Ian Cordasco said this looks like a bug in the unittest module, not py-flake8.
msg233425 - (view) Author: Ian Cordasco (icordasc) * Date: 2015-01-04 20:11
Keep in mind, this could also be a problem with NetBSD's distribution of python.
msg277571 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-09-28 00:56
The culprit is the ``test_suite='nose.collector'`` line here. It looks like this has already been fixed in nose:
Date User Action Args
2016-09-28 00:56:56berker.peksagsetstatus: open -> closed

nosy: + berker.peksag
messages: + msg277571

resolution: not a bug
stage: resolved
2015-01-04 20:11:15icordascsetmessages: + msg233425
2015-01-04 20:10:44icordascsetnosy: + icordasc
2015-01-03 19:38:03wizcreate