-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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' #4608
Comments
Duplicate of pytest-dev/pytest-cov#252. |
Hah! Literally the same title. Literally! Sorry about that. |
At least in another repo.. ;) |
Hi, I'm running into this issue with pytest version 4.3.0 (Python version 3.7.0). Please advise! |
Is there a specific version that is considered stable? |
UPDATE: I was able to bypass the error by reverting to pytest 3.x: pip install pytest==3.10.1 NOTE: I'm using anaconda. |
@s2t2 that function no longer exists in pytest 4, you can use |
Thanks @nicoddemus - I wasn't trying to use that function, nor was I attempting to invoke it, but rather just trying to run a simple test and getting errors. |
Just a simple invocation of |
Can you point to the docs you saw? We might have something outdated. |
@s2t2
|
cov-2.6.1 should fix this. |
Was originally following installation instructions here: https://docs.pytest.org/en/latest/getting-started.html I think it might be an anaconda thing. Here is some more info: s2t2/testing-123-py#2 |
@s2t2 |
if invoke pytest, the name of func you defined can't be with prefix "test". |
Spesific version is used because of the error I got. pytest-dev/pytest#4608
rename function solved for me |
@mirhmousavi that solution is a last stop measure - more recent versions of pytest-cov already have this done correctly - updating is preferred to editing random installed files |
@RonnyPfannschmidt I had installed |
Thanks for the follow up and happy programming |
I'm using Edit: |
Thanks @arvindpdmn for coming back to post the solution. 👍 |
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
Tests work if I pin pytest to this version. Updating to 4.1.0 breaks with this error:
I can reproduce the error and provide more information in case it isn't immediately clear what the issue is.
The text was updated successfully, but these errors were encountered: