Skip to content

Test execution order seemingly cannot be modified #347

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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