classification
Title: unittest: object has no attribute '_removed_tests'
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.4
process
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 "setup.py", line 74, in <module>
    test_suite='nose.collector',
  File "/usr/pkg/lib/python3.4/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/pkg/lib/python3.4/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/pkg/lib/python3.4/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/pkg/lib/python3.4/site-packages/setuptools/command/test.py", line 142, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/usr/pkg/lib/python3.4/site-packages/setuptools/command/test.py", line 122, in with_project_on_sys_path
    func()
  File "/usr/pkg/lib/python3.4/site-packages/setuptools/command/test.py", line 163, in run_tests
    testRunner=self._resolve_as_ep(self.test_runner),
  File "/usr/pkg/lib/python3.4/unittest/main.py", line 93, in __init__
    self.runTests()
  File "/usr/pkg/lib/python3.4/unittest/main.py", line 244, in runTests
    self.result = testRunner.run(self.test)
  File "/usr/pkg/lib/python3.4/unittest/runner.py", line 168, in run
    test(result)
  File "/usr/pkg/lib/python3.4/unittest/suite.py", line 87, in __call__
    return self.run(*args, **kwds)
  File "/usr/pkg/lib/python3.4/unittest/suite.py", line 130, in run
    self._removeTestAtIndex(index)
  File "/usr/pkg/lib/python3.4/unittest/suite.py", line 83, in _removeTestAtIndex
    self._removed_tests += test.countTestCases()
  File "/usr/pkg/lib/python3.4/unittest/suite.py", line 41, in countTestCases
    cases = self._removed_tests
AttributeError: 'FinalizingSuiteWrapper' object has no attribute '_removed_tests'
*** Error code 1


I have reported this

https://gitlab.com/pycqa/flake8/issues/19#note_712215

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: https://github.com/nose-devs/nose/issues/759
History
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