Skip to content

Test execution order seemingly cannot be modified #347

@podfran

Description

@podfran

When test order is modified with pytest_collection_modifyitems, the tests are still executed in alphabetic order of modules. A minimal example:

# test_first.py
def test_one():
    assert True

# test_second.py
def test_two():
    assert True

# conftest.py
def pytest_collection_modifyitems(items):
    items[:] = reversed(items)

Running this with pytest without the plugin indeed executes the tests in the opposite order. After installing the plugin, the order is reverted to alphabetical.

I tried @pytest.hookimpl() with trylast=True and tryfirst=True to no avail.

pytest==8.3.5
pytest_robotframework==4.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions