Skip to content

Incompatible with pytest-random-order with default config #23

@michamos

Description

@michamos

pytest-split is incompatible with pytest-random-order in its default configuration, as it performs the split after the tests have been randomized. However, pytest-split implicitly relies on the fact that the order of tests agrees between the different groups, which is not the case here, as each group will use a different random order. The consequence is that some tests will likely be selected twice and some other tests won't be selected at all.

A solution is to compute a global random seed before the tests and pass that value as an arg to --random-order-seed.

Could pytest-split try to detect if pytest-random-order is running and emit a warning if there is no --random-order-seed argument? In any case, I believe this should be documented. I can make a PR if you agree.

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