Skip to content

Commit

Permalink
Merge pull request #168 from minrk/no-empty-mark
Browse files Browse the repository at this point in the history
avod deprecation warning in `--slow-last` sorting
  • Loading branch information
minrk authored Mar 3, 2023
2 parents 74ba93c + 62ce1ce commit 5b06cc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from tempfile import TemporaryDirectory

import pytest
from _pytest.mark import Mark
from consul.aio import Consul
from jupyterhub.utils import exponential_backoff
from traitlets.log import get_logger
Expand Down Expand Up @@ -56,13 +55,14 @@ class Config:


# Define a "slow" test marker so that we can run the slow tests at the end
# ref: https://docs.pytest.org/en/6.0.1/example/simple.html#control-skipping-of-tests-according-to-command-line-option
# ref: https://stackoverflow.com/questions/61533694/run-slow-pytest-commands-at-the-end-of-the-test-suite
empty_mark = Mark("", [], {})


def by_slow_marker(item):
return item.get_closest_marker("slow", default=empty_mark)
m = item.get_closest_marker("slow")
if m is None:
return 0
else:
return 1


def pytest_addoption(parser):
Expand Down

0 comments on commit 5b06cc1

Please sign in to comment.