-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
#9133 added a new deselected
parameter to assert_outcomes()
, cc @okken.
However, this actually is an incompatible change: Doing e.g. result = testdir.runpytest("-k", "test_not_found_by_ini")
followed by result.assert_outcomes(passed=2)
worked fine before, but now fails because the now included 'deselected': ...
does not equal 'deselected': 0
.
This breaks pytest-bdd: pytest-dev/pytest-bdd#466 - I could swear I also saw another project in #9415 fail after fixing the initial issue it had, but then Christmas and stuff came along and now I don't remember which one it was, and of course can't find it anymore.
A (quite) rough search reveals that more projects might be affected by this (excludes to avoid matches in copies of pytest's source code).
Some examples I could dig up (but haven't verified):
- test_parametrization.py - schemathesis/schemathesis - Sourcegraph
- test_ipa_run_tests.py - freeipa/freeipa - Sourcegraph (maybe)
- test_parametrized.py - pytest-dev/pytest-play - Sourcegraph
I think the change in itself makes sense, but at the same time fixes like pytest-dev/pytest-bdd#470 are a bit cumbersome.
Two questions:
- What should we do about this for 7.0? (even if the answer just is "live with it and document it as backwards-incompatible in the changelog)
- What (if anything) should we do about this so that it doesn't happen again for future releases? I guess not much we can do, as long as we want to assume 0 for outcomes which have not been given...