question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'Function' object has no attribute 'get_marker'

See original GitHub issue
============= test session starts ===========
platform linux -- Python 3.6.6, pytest-4.0.2, py-1.7.0, pluggy-0.8.0 -- 
plugins: monkeytype-1.0.1, cov-2.6.0

Tests work if I pin pytest to this version. Updating to 4.1.0 breaks with this error:

platform linux -- Python 3.6.6, pytest-4.1.0, py-1.7.0, pluggy-0.8.0 -- 
plugins: monkeytype-1.0.1, cov-2.6.0

...

self = <pytest_cov.plugin.CovPlugin object at 0x7f13154272b0>, item = <Function test_part_compilation[PP]>

    @compat.hookwrapper
    def pytest_runtest_call(self, item):
>       if (item.get_marker('no_cover')
                or 'no_cover' in getattr(item, 'fixturenames', ())):
E               AttributeError: 'Function' object has no attribute 'get_marker'

/home/mbarkhau/miniconda3/envs/pycalver_py36/lib/python3.6/site-packages/pytest_cov/plugin.py:289: AttributeError

I can reproduce the error and provide more information in case it isn’t immediately clear what the issue is.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

10reactions
s2t2commented, Mar 6, 2019

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.

5reactions
arvindpdmncommented, May 6, 2020

I’m using pytest-cov 2.8.1 and still get the error.

Edit: Updating pytest-remotedata==0.3.0 to pytest-remotedata==0.3.2 solved the problem for me. Anaconda dist on Windows 10 but I updated using pip, not conda

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Function' object has no attribute 'get_marker' - Stack Overflow
Got this error on a very simple test using pytest version 4.6.3 . On searching, I came across this link where I found...
Read more >
pytest AttributeError get_marker
AttributeError: 'Function' object has no attribute 'get_marker'. The fix requires update of affiliated pytest-* packages to at least:.
Read more >
AttributeError: “Function”object has no attribute “get marker”
I have tried to follow the documentation but was not able to use urlparse.parse.quote_plus() in Python 3:from urllib.parse import urlparseparams ...
Read more >
'function' object has no attribute 'get' while saving onetoone ...
I am getting : AttributeError: 'function' object has no attribute 'get' while saving onetoone relation in django?
Read more >
pytestでAttributeError: 'Function' object has no attribute ...
問題pytestを実行しようとすると、身に覚えのない以下のようなエラーが発生する。AttributeError: 'Function' object has no attribute ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found