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.

Pytest Failing with new Release (4.1.0)

See original GitHub issue

Hello everybody,

I encounter that my Travis CI Build fails with the latest (2 hours old) Release of pytest 4.1.0.

The Error i get, for each Test, looks like this :

self = <pytest_cov.plugin.CovPlugin object at 0x2af7e0d326a0>
item = <Function test_model_existence>
    @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'
../../../virtualenv/python3.6.3/lib/python3.6/site-packages/pytest_cov/plugin.py:289: AttributeError

My conftest.py consists only of these 4 fixtures:

import pytest
from api.models import User, Contract, Shift, Report


@pytest.fixture
def user_model_class():
    return User


@pytest.fixture
def contract_model_class():
    return Contract


@pytest.fixture
def shift_model_class():
    return Shift


@pytest.fixture
def report_model_class():
    return Report

Finally we run the following command in Travis pipenv run pytest --cov=./

I do not believe that the Tests i run with those fixtures are explicitly relevant for this Error so i only describe what i do with them: I basically call hasattr(), isinstance() or issubclass() and a few basic assert A == B calls.

I allready looked into the Changelog and the docs if something corresponding to this error has changed but couldn’t find anything. From this point i could only speculate that the new Release breakes something with the pytest_cov Plugin (or visversa).

Any help on how to get this working is appreciated.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
ionelmccommented, Jan 6, 2019

Ah yes, I’ll make a quick release today or tomorrow.

0reactions
chgadcommented, Jan 6, 2019

Thank you very much guys, especially for the quick response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changelog — pytest documentation
<patch> ). Backward incompatible (breaking) changes will only be introduced in major versions with advance notice in the Deprecations section of releases.
Read more >
pytest test discovery fails since pytest version 4.1.0 #66626
This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in...
Read more >
Troubleshooting — pytest-qt documentation - Read the Docs
pytest-qt needs a DISPLAY to run, otherwise Qt calls abort() and the process crashes immediately. One solution is to use the pytest-xvfb plugin...
Read more >
pytest Documentation - Read the Docs
pytest Documentation, Release 0.1. Download latest version as PDF. CONTENTS ... After it finishes, pytest then shows a failure report.
Read more >
pytest-qt - PyPI
Since version 4.1.0, pytest-qt requires Python 3.7+. ... If you can, include some tests that exercise the new code or test that a...
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