Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unittest: object has no attribute '_removed_tests' #67344

Closed
0-wiz-0 mannequin opened this issue Jan 3, 2015 · 3 comments
Closed

unittest: object has no attribute '_removed_tests' #67344

0-wiz-0 mannequin opened this issue Jan 3, 2015 · 3 comments
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@0-wiz-0
Copy link
Mannequin

0-wiz-0 mannequin commented Jan 3, 2015

BPO 23155
Nosy @0-wiz-0, @berkerpeksag, @sigmavirus24

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2016-09-28.00:56:56.098>
created_at = <Date 2015-01-03.19:38:03.429>
labels = ['extension-modules', 'type-bug', 'invalid']
title = "unittest: object has no attribute '_removed_tests'"
updated_at = <Date 2016-09-28.00:56:56.096>
user = 'https://github.com/0-wiz-0'

bugs.python.org fields:

activity = <Date 2016-09-28.00:56:56.096>
actor = 'berker.peksag'
assignee = 'none'
closed = True
closed_date = <Date 2016-09-28.00:56:56.098>
closer = 'berker.peksag'
components = ['Extension Modules']
creation = <Date 2015-01-03.19:38:03.429>
creator = 'wiz'
dependencies = []
files = []
hgrepos = []
issue_num = 23155
keywords = []
message_count = 3.0
messages = ['233365', '233425', '277571']
nosy_count = 3.0
nosy_names = ['wiz', 'berker.peksag', 'icordasc']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue23155'
versions = ['Python 3.4']

@0-wiz-0
Copy link
Mannequin Author

0-wiz-0 mannequin commented Jan 3, 2015

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.

@0-wiz-0 0-wiz-0 mannequin added extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error labels Jan 3, 2015
@sigmavirus24
Copy link
Mannequin

sigmavirus24 mannequin commented Jan 4, 2015

Keep in mind, this could also be a problem with NetBSD's distribution of python.

@berkerpeksag
Copy link
Member

The culprit is the test_suite='nose.collector' line here. It looks like this has already been fixed in nose: nose-devs/nose#759

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant