-
-
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
RemovedInPytest4Warning causes errors at collection time #2652
Comments
I believe astropy and photutils both turn deprecation warnings into errors, correct? If so, then warnings raising an error is expected. But I agree that we should not raise that warning during collection time otherwise it will stop the entire suite. Ideally we should issue the warning during testing instead. @RonnyPfannschmidt is that doable you think? |
Oh, indeed that's it. I've just never seen an error due to this during collection time. |
@nicoddemus it will be a mess to track this as of now and imho its correct behaviour if warnigns are turned into errors imho we should have a mode where warnings are tracked always but dont error out pytest itself |
Yeah, seems like a problem given that at that point we are only dealing with
Hmm not sure I would like to complicate things more; one of the advantages of just using the builtin warnings module is to keep things simple on our side. Users which turn warnings into errors are free to use the warnings filter system to filter out pytest-specific warnings if they want to. Well given all this should we close this issue as "working as intended"? |
then we should have a followup on pytest warnings in the documentation to help those users avoid the problems i propose to make a ticket for introducing a pytest.PyTestWarning class anensuring we keep it in always warn mode we might want to investigate into having a pytest option that considers warning as errors but ensures the actual erroring happens at the end ofthe test |
That's #2452 I believe. 😉
Perhaps, although I would like to avoid adding more complexity to the warnings system in general as I said earlier unless absolutely necessary. |
good call, i added a note to #2452 im closing this one as works as intended, enhancement upcoming |
I assume the deprecation of marks applied directly to parameters should only generate a warning rather than errors at collection time. We run into it both in astropy and photutils: astropy/astropy#6418
While the fix is trivial in our tests, we may still need to stick with the old version and pytest <3.2 for a while as some of our CI setups still uses pytest 3.0.x. (Also our LTS version requires pytest>=2.8).
pip list
of the virtual environment you are usingThe text was updated successfully, but these errors were encountered: