Skip to content
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

Make 'warnings' and 'deselected' in assert_outcomes optional #9475

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

nicoddemus
Copy link
Member

Fix #9471

I don't think we need a CHANGELOG here, as this has not really been officially released yet.

@nicoddemus nicoddemus added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Jan 4, 2022
@The-Compiler
Copy link
Member

I'm not sure if I like the approach to be honest... while it is indeed convenient, I fear the asymmetry could lead to a silent mode of failure, where people expect e.g. warnings to be checked, but that does not happen.

@nicoddemus
Copy link
Member Author

I was trying to fix the regression... should we keep the regression then? Fix this some other way?

@The-Compiler
Copy link
Member

Agreed that this would fix the regression - but I'm not sure if it's the right way forward. I think I personally would prefer documenting this as a breaking change instead.

However it sounded like @RonnyPfannschmidt was in favor of this approach in #9471, so I might be overridden on that. 😉

Maybe @okken has an opinion on this?

@RonnyPfannschmidt
Copy link
Member

I totally agree with the sentient of @TheCompiler

My personal preference is to fix the regression first, then think about warning and /or plannable breaking changes

The problem is that the api initially was incomplete, and likely still is incomplete, so we ought to consider the states explicitly and implicitly checked for

@nicoddemus
Copy link
Member Author

OK, closing this then. 👍

@RonnyPfannschmidt
Copy link
Member

reopening as its preferable not to break users while we figure the correct long term solution

@The-Compiler
Copy link
Member

Let me note that we already had breaking changes to this API (without any kind of deprecation period) in pytest 6, via #6505. I've seen some version checks to account for that in the wild, but don't remember where.

So I guess the question is whether we'd rather:

  1. Avoid additional breakage, but in return have an API which is inconsistent and could silently hide problems, especially with warnings (yes, they have been hidden before expose warnings= to pytester assert_outcomes() #8952 I think - but it seems like a good thing to make pytester tests fail if the subprocess has warnings by default, no)?
  2. Have another breaking change there, accept the breakage, but of course document it.

I'd prefer 2) over an inconsistent API - but then again 1) would probably mean that if we clean this up in form of some kind of different API, plugins then need to account for four different ways of doing the same thing, which isn't ideal either...

Thoughts? I'm fine with merging this and defer a better API to another release, but I feel like there is a trade-off...

also cc-ing @symonk

@The-Compiler
Copy link
Member

Bump? I feel like we need a decision here to avoid blocking the 7.0.0 final. As said, I'm fine with being overridden on this, I just hope it won't paint us into a corner.

@nicoddemus
Copy link
Member Author

The safest one, feature wise, is 2: close this PR and accept the breakage. But I don't have strong feelings either, so what you folks decide it is fine.

@RonnyPfannschmidt
Copy link
Member

the breakage will be a utter pain for all plugin testsuites supporting multiple pytest versions,

@The-Compiler
Copy link
Member

ok, let's go for this then to get things unstuck, and hope we can come up with a better API altogether in the future...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[prerelease] deselected addition to assert_outcomes() is backwards-incompatible
3 participants