You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression in 3.7.0: AttributeError for _collectfile #3742
I get AttributeError: 'FlakesItem' object has no attribute '_collectfile' when running devpi-server tests with tox (tox -e py27 is enough) since pytest 3.7.0. When I pin to pytest<3.7dev it works (using 3.6.4).
It seems to be related to the current working directory. The tox config switches to test_devpi_server. When I run pytest in server it's fine, when i run in server/test_devpi_server it breaks.
GitMate.io thinks possibly related issues are #707 (pytest-xdist regression since execnet 1.3.0), #2968 (Memory usage in 3.3.0), #1083 (Regression with parallel tests on 2.7.3 and 2.8), #386 (tests fail with pexpect-3.0), and #1572 (Making _CallOutcome.result private in 3.0).
============================= test session starts ==============================
platform linux -- Python 3.6.4, pytest-3.7.0, py-1.5.4, pluggy-0.7.1
rootdir: /var/lib/jenkins/jobs/Simplereg/workspace, inifile:
plugins: xdist-1.22.5, twisted-1.8, pep8-1.0.6, forked-0.2, cov-2.5.1
collected 0 items / 1 errors
==================================== ERRORS ====================================
______________________________ ERROR collecting _______________________________
.tox/py36/lib/python3.6/site-packages/_pytest/runner.py:201: in __init__
self.result = func()
.tox/py36/lib/python3.6/site-packages/_pytest/runner.py:261: in <lambda>
call = CallInfo(lambda: list(collector.collect()), "collect")
.tox/py36/lib/python3.6/site-packages/_pytest/main.py:475: in collect
for x in self._collect(arg):
.tox/py36/lib/python3.6/site-packages/_pytest/main.py:519: in _collect
for x in root._collectfile(pkginit):
E AttributeError: 'Pep8Item' object has no attribute '_collectfile
We're seeing this error after the update pytest 3.6 -> 3.7:
__________________________ ERROR collecting _______________________________
�[1m�[31m/home/travis/miniconda/envs/test/lib/python2.7/site-packages/_pytest/runner.py�[0m:201: in __init__
�[1m self.result = func()�[0m
�[1m�[31m/home/travis/miniconda/envs/test/lib/python2.7/site-packages/_pytest/runner.py�[0m:261: in <lambda>
�[1m call = CallInfo(lambda: list(collector.collect()), "collect")�[0m
�[1m�[31m/home/travis/miniconda/envs/test/lib/python2.7/site-packages/_pytest/main.py�[0m:475: in collect
�[1m for x in self._collect(arg):�[0m
�[1m�[31m/home/travis/miniconda/envs/test/lib/python2.7/site-packages/_pytest/main.py�[0m:519: in _collect
�[1m for x in root._collectfile(pkginit):�[0m
�[1m�[31mE AttributeError: 'Pair' object has no attribute '_collectfile'�[0m
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
Activity
The-Compiler commentedon Jul 31, 2018
Not sure if this is an issue in pytest itself, or the pytest-flakes plugin.
pytestbot commentedon Jul 31, 2018
GitMate.io thinks possibly related issues are #707 (pytest-xdist regression since execnet 1.3.0), #2968 (Memory usage in 3.3.0), #1083 (Regression with parallel tests on 2.7.3 and 2.8), #386 (tests fail with pexpect-3.0), and #1572 (Making _CallOutcome.result private in 3.0).
RonnyPfannschmidt commentedon Jul 31, 2018
this is a regression made by pytest -
root._collectfilegot introduced in #3389this triggered a unintentional regression as now a private api is used in more places and on objects that dont belong to it
JohanLorenzo commentedon Jul 31, 2018
Hello! Thank you for this great library! The Mozilla release engineering team relies on it for several projects 😃
I just found a similar regression:
This async generator is a regular
aiohttp.ClientSession()and is initialized here. This might be an integration issue with thepytest-asyncioplugin.I rolled pytest back to 3.6.4 and things are back working. You can see both the failure and the workaround in
RonnyPfannschmidt commentedon Jul 31, 2018
@JohanLorenzo this is a different issue - related to fixture definitions, please open a new issue
JohanLorenzo commentedon Jul 31, 2018
Thanks for the quick answer. I opened #3747
Thomasillo commentedon Jul 31, 2018
Same here with flake8:
ThreePinkApples commentedon Jul 31, 2018
Getting the same with PEP8
cdeil commentedon Jul 31, 2018
We're seeing this error after the update pytest 3.6 -> 3.7:
https://travis-ci.org/gammapy/gammapy/jobs/410288389#L2253
Same issue or a different one?
RonnyPfannschmidt commentedon Jul 31, 2018
same all issues that are triggered by
_collectfilemissing on 3rd party items are due to this oneits an entirely unintended issue
[-]Regression in 3.7.0[/-][+]Regression in 3.7.0: AttributeError for _collectfile[/+]castarco commentedon Jul 31, 2018
In our team we're suffering the same problem, we had to fix the pytest version to 3.6.4 to avoid this regression.
4 remaining items
RonnyPfannschmidt commentedon Aug 1, 2018
as far as i can tell the code paths considering the change of root are incorrect, falling back to self is only hiding the issue
henry0312 commentedon Aug 1, 2018
I don't understand why
__collectfilewith the lastrootis called.mark the failing test for pytest-dev#3742 as strict xfail so we can m…
Temporary fix pytest version, pytest-dev/pytest#3742
Freeze pytest==3.6.*. Regression in pytest-dev/pytest#3742
Merge pull request #3751 from nicoddemus/collect-file-bug
Add changelog for #3742
Update pytest to 3.7.1 (#24)
Merge #26
Better the fix for pytest-dev#3742.
Update pytest to 3.7.1 (#1247)
darland commentedon Aug 15, 2018
I got the same error if I run tests like this
pytest tests/unit/*.pyBut if I run like this
pytest tests/unit/, it passes.Update pytest to 3.7.2 (#8)
Scheduled monthly dependency update for October (#389)