Skip to content

Randomisation not compatible with custom test collection #26

Closed
@ringods

Description

@ringods

I have written two custom pytest plugins to test different aspects of an internal product. Each of these plugins has a custom way of collecting tests, passing custom subclasses of pytest.File, pytest.Collector and pytest.Item back to pytest.

The pytest-random-order only works with the global random bucket-type. All other bucket-type functions use the member module, which is defined in the pytest python plugin:

https://github.com/pytest-dev/pytest/blob/d61a7670a1d50eab367dfac03896d2811dbf5279/_pytest/python.py#L210

Since I pass back a tree with collections of tests (root -> File* -> Collector* -> Item*), it would be nice if randomisation could happen at the different levels of my custom pytest plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions