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 plugin opt-in #2443

Closed
wants to merge 1 commit into from

Conversation

nicoddemus
Copy link
Member

Fix #2430

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we just disable it that way, we would have to do a 4.0 release and i would like to get feedback from @hpk42

my understanding is that the main cause is in

https://github.com/pytest-dev/pytest/blob/master/_pytest/warnings.py#L53-L56

the most apparent blunder being the addition of the once filter

personally i'd prefer to just strike out that filter, so that we don't change any behavior unless requested by options

@@ -99,7 +99,7 @@ def directory_arg(path, optname):
"mark main terminal runner python fixtures debugging unittest capture skipping "
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion "
"junitxml resultlog doctest cacheprovider freeze_support "
"setuponly setupplan warnings").split()
"setuponly setupplan").split()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if done like that, we will have to do a 4.0 release

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the most apparent blunder being the addition of the once filter

Not really, unfortunately catch_warnings will remove all current filters in order to be able to catch all warnings. That filter is there just to prevent the same warning to be triggered more than once by the same test.

How would you like to make this change without making a 4.0 release? Or do you want to make a 4.0 release regardless?

@The-Compiler
Copy link
Member

I'm not sure what to think about this... I can see it's problematic how it broke some stuff, but with this we turn loud failures into silent failures. Now that everyone removed the pytest-warnings plugin or custom code to fail on warnings from their testsuites, they upgrade (and I bet there are people who don't read the changelog) and suddenly warnings from their testsuite pass silently...

@RonnyPfannschmidt
Copy link
Member

@The-Compiler we shouldn't take responsibility for crude workarounds instead of version pins

if at all we should in future warn if people disable core bits

@The-Compiler
Copy link
Member

What crude workarounds? I'm not talking about people disabling anything. I'm talking about us disabling something which was enabled before, and that enabling causing people to get rid of custom solutions.

@RonnyPfannschmidt
Copy link
Member

@The-Compiler then we need a correct default filter - because the one we use is broken with absolute certainty

@The-Compiler
Copy link
Member

As @nicoddemus mentioned in #2443 (comment) it's probably not as easy as that.

@RonnyPfannschmidt
Copy link
Member

@The-Compiler the assessment that catch_warnings removes all filters is incorrect,

as per code and doc-string it does a copy, and restores that backup

@The-Compiler
Copy link
Member

...which still has the same effect: All existing filters are disabled while a test runs.

@RonnyPfannschmidt
Copy link
Member

@The-Compiler incorrect, filters add to it, and one too simple filter added to the filter list simply overrides everything because it matches first

@nicoddemus
Copy link
Member Author

Closing in favor of #2445

@nicoddemus nicoddemus closed this May 30, 2017
@nicoddemus nicoddemus deleted the warnings-opt-in branch May 30, 2017 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants