-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Trying to ignore custom warning from the package to test raises errors #8343
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
Comments
Thanks for a great bug report @Bibo-Joshi. I think the issue this:
To verify this, I used I am not sure what is the best behavior here, I need to think about it. I wonder what others think. |
Hey, thanks for the quick reply :) I can confirm that |
You are correct, previously in 6.1.x that warning was not captured, but it is now.
To reiterate, I suggest to actually install the module you are testing in the virtual environment using HTH 👍 |
Hi!
I'm trying to upgrade my test suite from v4.2.0 to the current version (6.2.2) and facing issues regarding
filterwarnings
. Specifically I'm trying to ignore the custom deprecation warning defined in the package that I'm testing. Specifying that insetup.cfg
asresults in a traceback ending on
i.e. the std warnings library can't find the package. The full traceback is here. Also it doesn't seem to matter if the configuration is done via
setup.cfg
orpyproject.toml
(didn't trypytest.ini
…)I'm not sure if I can change the configuration in some way. However, this still works in v6.1.x and IISC the failure in v6.2.x is due to #7700. That's why I chose the bug template rather than the question template …
To clarify: Calling
warnings._getcategory('package.CustomWarnings')
manually in the same directory I'm running pytest from secceeds. So I guess it's some sort of cwd problem.For now the workaround suggested at #7525 (comment) seems to work, i.e.
does the trick. Still, I'd be happy if I could specify this in the config file again :)
Output of
pip list
pytest & OS:
v6.2.2 on Windows 10
MWE
Can be found at https://github.com/Bibo-Joshi/ci-test
The text was updated successfully, but these errors were encountered: