--ff option doesn't work in pytest #6531
Comments
To iterate, what I would expect the stdout to be is something like this:
and stop there. |
I don't know if |
CC @callahad |
So instead of |
THanks! I'll definitely try that instead because it sounds like a match made in heaven. |
@peterbe This works for me in a simpler case. I inserted an When I initially run with
Then when I run it again, I see:
Note the first, passing test was successfully skipped and didn't print a dot. My exact invocation is Similarly, using
|
I see the same thing you do if I put an |
Adding
So what do those tests have in common that our failing test does not? |
Looks like it's running every single top-level test in that file before dropping down into the KumaGitHubTests class. Why, I do not yet know. |
This is due to pytest-django's re-ordering of test items. See pytest-dev/pytest-django#214 Commenting out the I wonder if it's possible to tell pytest in which order to evaluate plugins, so that the |
Decorating that function with |
Upstream issue at pytest-dev/pytest-django#819 |
Closing this here; it's not our issue and I don't see an obvious way to address it in our codebase, at least not from skimming the pytest docs on plugins. |
Summary
I'm running
pytest kuma/users/tests/test_views.py -x --ff
and it fails on one of the tests. That's fine and expected. It fails on the 29th test. Meaning, it worked on 28 other tests. That's fine.But when I run it a second time the
--ff
option should start with the test that failed the last time first. That makes it easy to re-run and re-run without having to fail for all those tests that work. But it keeps running all other tests first. Again.Steps To Reproduce (STR)
See above. However, all I did was inject a
assert 0
somewhere inkuma/users/views.py
which correctly breaks at least one test.It might be different when there's an
assert 0
somewhere in a test function insidekuma/users/tests/test_views.py
.Actual behavior
See above.
Expected behavior
That it should run the test that failed first
Additional context
pytest
prints information about test running when it starts. This is what I see:The text was updated successfully, but these errors were encountered: