-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[prerelease] deselected
addition to assert_outcomes()
is backwards-incompatible
#9471
Comments
@okken would you like to make the deselected a optional parameter to ensure this is caught i believe we have to make certain new features "explicit optionals" instead of implied optionals this one is a easy miss, i'm pretty sure at least 3 of us missed this when glancing at the pr before, and we would miss a issue like that again, as making it visible would require a explicit and elaborate design of the matcher to begin with this type of regression is pretty much only caught by overly detailed test suites, so given the circumstances we rather ought to focus on making it inexpensive to react on them lets try to make it a actual optional parameter before 7.0 but not get hung up on it in case it turns out tricky |
Optional seems fine. |
Apologies for. Not noticing this question until now. I’m impressed with the pragmatism of the solution. |
Is there more work to do on this, or does #9475 solve this? |
@okken the pr (that i jsut reopened) just sillves the immediate regression there still is need for a better long term plan for that api, as its not exactly lending itself to extension |
This is still open. Is someone waiting for me to do something? If so, what? |
#9133 added a new
deselected
parameter toassert_outcomes()
, cc @okken.However, this actually is an incompatible change: Doing e.g.
result = testdir.runpytest("-k", "test_not_found_by_ini")
followed byresult.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):
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:
The text was updated successfully, but these errors were encountered: