Skip to content

Pytest-order breaks the fixture scope for parametrized fixtures #49

Discussion options

You must be logged in to vote

Copying the slightly adapted answer from Stack Overflow here:

This is actually expected behavior and not a bug, because the tests are explicitely ordered, and this ordering is done after any initial ordering due to the fixture usage.

There is a possibility to change this behavior, if using the option --indulgent-ordering. This changes the sequence of the ordering, so that the tests are first ordered by the plugin, and afterwards by the fixture.

Here is the behavior without the option:

$ python -m pytest --collect-only
<Package tests>
  <Module test_one.py>
    <Class TestClass>
        <Function test2[1]>
        <Function test2[2]>
        <Function test1[1]>
        <Function test1[2]>

W…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mrbean-bremen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #48 on July 24, 2021 18:53.