diff --git a/launch_pytest/launch_pytest/plugin.py b/launch_pytest/launch_pytest/plugin.py index 57b7a5294..c63fcf002 100644 --- a/launch_pytest/launch_pytest/plugin.py +++ b/launch_pytest/launch_pytest/plugin.py @@ -213,7 +213,7 @@ def from_parent(cls, *args, **kwargs): # Part of this function was adapted from # https://github.com/pytest-dev/pytest-asyncio/blob/f21e0da345f877755b89ff87b6dcea70815b4497/pytest_asyncio/plugin.py#L37-L50. # See their license https://github.com/pytest-dev/pytest-asyncio/blob/master/LICENSE. -@pytest.mark.tryfirst +@pytest.hookimpl(tryfirst=True) def pytest_pycollect_makeitem(collector, name, obj): """Collect coroutine based launch tests.""" if collector.funcnamefilter(name) and is_valid_test_item(obj): @@ -275,7 +275,7 @@ def get_fixture_params(item): return get_fixture_params(left_item) == get_fixture_params(right_item) -@pytest.mark.trylast +@pytest.hookimpl(trylast=True) def pytest_collection_modifyitems(session, config, items): """Move shutdown tests after normal tests.""" def enumerate_reversed(sequence):