From 3966f65c95cbad9f5adc99d9c396178008409c37 Mon Sep 17 00:00:00 2001 From: Ilyas Niyazov Date: Mon, 17 Mar 2025 16:24:36 +0300 Subject: [PATCH] [#364] Fixed hook order tests collection Signed-off-by: Ilyas Niyazov --- src/frostfs_testlib/hooks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frostfs_testlib/hooks.py b/src/frostfs_testlib/hooks.py index 1ada660..c56c75a 100644 --- a/src/frostfs_testlib/hooks.py +++ b/src/frostfs_testlib/hooks.py @@ -16,6 +16,9 @@ def pytest_add_frostfs_marker(items: list[pytest.Item]): # pytest hook. Do not rename @pytest.hookimpl(trylast=True) def pytest_collection_modifyitems(items: list[pytest.Item]): + # The order of running tests corresponded to the suites + items.sort(key=lambda item: item.nodeid) + # Change order of tests based on @pytest.mark.order() marker def order(item: pytest.Item) -> int: order_marker = item.get_closest_marker("order") -- 2.45.3