From 62ce1ce41a66f9fd36d077286278144ac0d69d15 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 3 Mar 2023 15:03:51 +0100 Subject: [PATCH] avod deprecation warning in `--slow-last` sorting --- tests/conftest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1c012ac0..4bd2b072 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 @@ -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):