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

Run deprecated import check before imports from other tests #87

Merged
merged 2 commits into from
Apr 23, 2022

Conversation

radarhere
Copy link

Fixes failures in python-pillow#6237

The test failures are because import statements like https://github.com/python-pillow/Pillow/blob/dd7cbdec95f4e8d31bc99d37ce6fb6cf7501849a/Tests/test_imageqt.py#L5 are stealing the deprecation warning. It seems that pytest runs the test files all first, before running the tests themselves.

My solution here is to

  • while keeping the asserts where they are, move the import outside of the test
  • rename the test file to test_deprecated_imageqt.py, moving it earlier than test_image_fromqimage.py, test_qt_image_toqimage.py, test_qt_image_qapplication.py and test_imageqt.py

@radarhere
Copy link
Author

I've pushed another commit to upgrade to PyQt6.

@hugovk
Copy link
Owner

hugovk commented Apr 23, 2022

Thanks!

@hugovk hugovk merged commit b32641a into hugovk:deprecate-qt5 Apr 23, 2022
@radarhere radarhere deleted the deprecate-qt5 branch January 28, 2023 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants