From 4eb4963f17c1ef34d13b515863bb33728174f9a7 Mon Sep 17 00:00:00 2001 From: Andrey Berezin Date: Thu, 3 Nov 2022 16:17:08 +0300 Subject: [PATCH] Make node management tests to be last Signed-off-by: Andrey Berezin --- pytest_tests/testsuites/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pytest_tests/testsuites/conftest.py b/pytest_tests/testsuites/conftest.py index f633683e..5d066f42 100644 --- a/pytest_tests/testsuites/conftest.py +++ b/pytest_tests/testsuites/conftest.py @@ -19,6 +19,13 @@ from python_keywords.node_management import node_healthcheck logger = logging.getLogger("NeoLogger") +def pytest_collection_modifyitems(items): + # Make network tests last based on @pytest.mark.node_mgmt + def priority(item: pytest.Item) -> int: + is_node_mgmt_test = item.get_closest_marker("node_mgmt") + return 0 if not is_node_mgmt_test else 1 + + items.sort(key=lambda item: priority(item)) @pytest.fixture(scope="session") def configure_testlib():