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

AttributeError: 'Function' object has no attribute 'get_closest_marker' #24

Closed
gshif opened this issue Apr 5, 2019 · 5 comments
Closed

Comments

@gshif
Copy link

gshif commented Apr 5, 2019

Have a question. I am running python 2.7.14 with pytest 3.0.7 on MAC
I am always seeing an error:

INTERNALERROR>   File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytest_github/plugin.py", line 323, in pytest_itemcollected
INTERNALERROR>     marker = item.get_closest_marker('github')
INTERNALERROR> AttributeError: 'Function' object has no attribute 'get_closest_marker'

Any help would be greatly appreciated

@jlaska
Copy link
Owner

jlaska commented Apr 5, 2019

@kdelee Would you mind taking a look at this one? Appears related to the recent get_closest_marker changes.

@gshif
Copy link
Author

gshif commented Apr 29, 2019

Hi @jlaska, @kdelee,
I just wanted to follow up on my original question whether you were able to take a look at the error.
Thanks.

@kdelee
Copy link
Collaborator

kdelee commented May 2, 2019

@gshif 👋 hey just now noticing this! Will take a look.

Can you confirm what version of pytest you have installed? I'm 99% sure you have an old version of pytest installed.

I made these updates due to the fact that the old way of getting these markers was deprecated.
Here's the docs about how to update the code that I used:
https://docs.pytest.org/en/latest/mark.html#update-marker-code
Here's the PR that removed the old functionality: pytest-dev/pytest#4564
Here's the first commit I could find that had the new functionality: pytest-dev/pytest@4914135

I am guessing that means the new function became a thing around 3.6.0 time period.
I started seeing the depreciation warnings around the 3.10 time period.
It breaks if you don't have this update in 4.0.

If you are not able to update to pytest 4.0 because of other changes, try pytest 3.10.

@gshif
Copy link
Author

gshif commented May 15, 2019

Thanks @kdelee,

@kdelee
Copy link
Collaborator

kdelee commented May 23, 2019

sounds like this can get closed (I don't have power to do that)

@jlaska jlaska closed this as completed May 23, 2019
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

3 participants