Skip to content

Commit

Permalink
conftest.py: Don't use deprecated get_marker() function
Browse files Browse the repository at this point in the history
Starting from `pytest` version 4.1.0, `Node.get_marker()` has been
removed, and hence our tests break when running with newer versions of
`pytest`. It was deprecated since a while back but it has recently been
removed completely. Use `get_closest_marker()` as a replacement that is
suggested in the changelog, and seems to work fine for our use case.

See pytest-dev/pytest#4564 for more context on
the upstream issue.

One way of verifying this change is that this should fix the recently
added `tests-fedora-update-deps` job, that was failing before due to
this issue.

(cherry picked from commit c91784a)
  • Loading branch information
cs-shadow committed Jan 19, 2019
1 parent 2a50a3d commit aa98320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def pytest_addoption(parser):


def pytest_runtest_setup(item):
if item.get_marker('integration') and not item.config.getvalue('integration'):
if item.get_closest_marker('integration') and not item.config.getvalue('integration'):
pytest.skip('skipping integration test')


Expand Down

0 comments on commit aa98320

Please sign in to comment.