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

pylama not compatible with pytest 3.7.0 #126

Closed
bewing opened this issue Aug 1, 2018 · 1 comment
Closed

pylama not compatible with pytest 3.7.0 #126

bewing opened this issue Aug 1, 2018 · 1 comment

Comments

@bewing
Copy link

bewing commented Aug 1, 2018

Pytest 3.7.0, recently released, does not work with the --pylama option, failing as follows:

.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: 'PylamaItem' object has no attribute '_collectfile'

It appears to be related to this change:
pytest-dev/pytest@fedc785

Tested on both Python 2.7 and 3.6, and confirmed that tests collect and linting occurs on pytest==3.6.4, but fails with the above error on pytest==3.7.0

It looks like pytest is expecting pylama to implememt/override pytest.Package._collectfile(), but pylama.pytest.PylamaItem only inherits from pytest.File and pytest.Item. I'm not sure if the fix is also to inherit from pytest.Package, or if this is an issue in pytest where they should be checking if the plugin inherits from Package

@bewing
Copy link
Author

bewing commented Aug 1, 2018

Appears to be an upstream regression:

pytest-dev/pytest#3742

@bewing bewing closed this as completed Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant