Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Drop pytest warning config in nightly tests#23130

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 2 commits intomatplotlib:mainfromQuLogic:fix-nightly-again
May 25, 2022

Conversation

QuLogic
Copy link
Member

@QuLogicQuLogic commentedMay 25, 2022
edited
Loading

PR Summary

Apparently, NumPy or whatever dependency has fixed the warnings that we needed to ignore.Tests with nightlies enabled seem to be passing just fine.

And having this file is causing pytest to drop some config we used to have, making it load files we don't want.

Fixes#23084.

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • [n/a] New features are documented, with examples if plot related.
  • [n/a] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

Apparently, NumPy or whatever dependency has fixed the warnings that weneeded to ignore. And having this file is causing pytest to drop someconfig we used to have, making it load files we don't want.
@QuLogicQuLogic added this to thev3.6.0 milestoneMay 25, 2022
@QuLogic
Copy link
MemberAuthor

Actually, looking a bit closer, I see warnings fromexamples/scales/log_test.py, which we definitely don't want to run.

Locally, I seepytest --collect-only | rg examples shows warnings from the examples, but they aren't collected. That's because they have top-level code, but no test functions/classes. So I wonder if we should add apytest.ini by default that tells pytest to ignore those directories.

And then also turn warnings into errors in the nightly build (by mostly reverting this PR), so we catch things from upstream?

@QuLogic
Copy link
MemberAuthor

After some further investigation, I think I see the reason for the inconsistency. For stuff inlib, we have aconftest.py that configures warnings into errors and ignores a few:

("filterwarnings","error"),
("filterwarnings",
"ignore:.*The py23 module has been deprecated:DeprecationWarning"),
("filterwarnings",
r"ignore:DynamicImporter.find_spec\(\) not found; "
r"falling back to find_module\(\):ImportWarning"),

We don't have that forexamples, so that's why the warnings depend on the config inpytest.ini. Thedistutils warning is not ignored above though, and I assume from that that the upstream code has been fixed to not trigger those.

What that means is that I'm going to keep the commit above, dropping thepytest.ini in the nightly test. But I amalso going to add apytest.ini that tells pytest to only look inlib, as we don't want it trying to importexamples,tutorials, etc.

This prevents it from trying to look at examples or other documentation,some of which may match the test file glob, but won't contain tests.
@@ -0,0 +1,7 @@
[pytest]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have a strong preference here, but would it make sense to add this to thesetup.cfg since we already have that? It seems like a lot of configuration stuff is getting put into that andpyproject.tomls now.

Copy link
Member

@timhoffmtimhoffmMay 25, 2022
edited
Loading

Choose a reason for hiding this comment

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

Let’s for now stick with pytest.ini. Long term this should go into pyproject.toml. However creating it only for pytest may be a bit confusing. Setup.cfg is not really recommended for pytesthttps://docs.pytest.org/en/6.2.x/customize.html#setup-cfg.

@timhoffmtimhoffm merged commit3048d7b intomatplotlib:mainMay 25, 2022
@QuLogicQuLogic deleted the fix-nightly-again branchMay 25, 2022 19:26
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@greglucasgreglucasgreglucas approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

[TST] Upcoming dependency test failures
3 participants
@QuLogic@timhoffm@greglucas

[8]ページ先頭

©2009-2025 Movatter.jp