-
Notifications
You must be signed in to change notification settings - Fork 213
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
AttributeError: 'Function' object has no attribute 'get_marker' #252
Comments
Possibly because of this pytest-dev/pytest#4564? |
this should have been triggering errors since |
We are seeing the same error with latest version of OK: |
version 4.1.0 was updated on PyPI on Jan 6, 2019, which broke pytest-cov pytest-dev/pytest-cov#252
Until pytest-dev/pytest-cov#252 get fixed
Fixed in #253. |
pytest-cov is not tested against current/newer pytest versions. |
Indeed, that was the idea... can anyone explain why was that not the case? Perhaps migrating directly from 3.X to 4.1 caused this? |
@nicoddemus i just noted the detail issue - remember get_marker function it was only documented deprecated, but the actual warnings got triggered by usage of the return value https://github.com/pytest-dev/pytest/pull/4564/files#diff-c4fc03c3a0d271a27a48958fb69a6b6f basically |
The application should control whether warnings should be visible or not. By hardcoding the simplefilter we turn on warnings' visibility for all modules that follow. Removing this allows the application code to decide if warnings should be shown. To enable warnings through the command line pass -Wd to the python interpreter. Quoting the python warnings module documentation[0]: > You can do this from the command-line by passing -Wd to the interpreter (this > is shorthand for -W default). This enables default handling for all warnings, > including those that are ignored by default. To change what action is taken > for encountered warnings you simply change what argument is passed to -W, > e.g. -W error. See the -W flag for more details on what is possible. [0]: https://docs.python.org/2/library/warnings.html#updating-code-for-new-versions-of-python Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
pytest-cov 2.6.1 is released. |
Oops! Seems like I should blame another repo for not catching up yet like you did ;) I'll post there, maybe with a proper PR. Thanks! |
Could you please link to the PR where you fixed this issue so I can fix it in another repo depending on pytest? |
@AlmogCohen I do believe it was fixed in #253 |
@AlmogCohen Note there is getsentry/pytest-responses#7 already 😉 |
Currently seeing this with pytest-cov 2.6.1
|
@rawrgulmuffins This looks like a bug in pytest-remotedata |
@rossmacarthur I'll go make an issue that links to this one then. |
|
|
Seeing this on test scripts when run from latest docker image: pytest-dev/pytest-cov#252
Is there any fix for this? Thanks. |
@prashant-bansod This seems completely unrelated to pytest-cov or pytest-remotedata. You'll need to ask the author of |
Seems to be fixed in |
@nicoddemus It's also fixed in pytest-remotedata 0.3.1 which @prashant-bansod has installed - based on the stacktrace above, the error @prashant-bansod is seeing is in their testsuite (or whatever |
Errors: > remote_data = item.get_marker('remote_data') E AttributeError: 'Function' object has no attribute 'get_marker' REF: - https://stackoverflow.com/questions/54254337/pytest-attributeerror-function-object-has-no-attribute-get-marker - pytest-dev/pytest#4608 - pytest-dev/pytest-cov#252 modified: environment.yml
Errors: > remote_data = item.get_marker('remote_data') E AttributeError: 'Function' object has no attribute 'get_marker' REF: - https://stackoverflow.com/questions/54254337/pytest-attributeerror-function-object-has-no-attribute-get-marker - pytest-dev/pytest#4608 - pytest-dev/pytest-cov#252 modified: environment.yml
I just started getting the following error with pytest-cov v2.6.0, pytest v4.1.0 on Python 3.4.6, PyPy, and PyPy3
How to replicate
Create a virtualenv with Python 3.4.9
pip install pytest==4.1.0 pytest-cov==2.6.0
Create
something.py
with the following contents:pytest --cov=something something.py
Pytest output
The text was updated successfully, but these errors were encountered: