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

pytest: don't cast warnings to errors #1793

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

adamjstewart
Copy link
Collaborator

Previously, all warnings were cast to errors when running pytest. This helped uncover the use of deprecated features, allowing us to stay on top of deprecations and ensure support for future versions of dependencies.

However, this also meant that minor platform-specific or version-specific warning messages would cause pytest to fail. Although it's maintainable in CI, it's impossible to support all the platforms and versions our developers are using.

This PR disables the casting of warning messages to errors. We'll need to be careful to make sure the release branch is relatively warning-free before making a release, but this will make life much easier for our developers.

@yichiac

@github-actions github-actions bot added the dependencies Packaging and dependencies label Jan 2, 2024
@adamjstewart
Copy link
Collaborator Author

Related to pytest-dev/pytest#10613

@calebrob6
Copy link
Member

This makes life easier for developers as they don't need to use the CI versions of all of our dependencies?

@adamjstewart
Copy link
Collaborator Author

The versions in requirements/*.txt change every day. But even using those exact same versions is no guarantee that you won't have warnings. For example, PyTorch raises some warnings on MPS when it falls back on the CPU, but these warnings don't occur in CI because the hardware is emulated and PyTorch isn't installed with MPS support. @yichiac encountered an issue recently where torchvision installed by Spack would issue a warning if png/jpeg support wasn't also installed. All of these warnings get promoted to errors and the tests fail locally.

@calebrob6
Copy link
Member

Makes sense!

@adamjstewart adamjstewart merged commit bb1c972 into microsoft:main Jan 2, 2024
21 checks passed
@adamjstewart adamjstewart deleted the pytest/warnings branch January 2, 2024 16:33
@adamjstewart adamjstewart added this to the 0.5.2 milestone Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Packaging and dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants