-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MNT: move pytest.ini configs to .toml #27094
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
Conversation
I can reproduce the "partially initialized" errors locally against
I note that CI uses matplotlib/.github/workflows/tests.yml Line 311 in 112a225
Pytest docs say this about invoking that way. I also note that the following gives me a bunch of failures that I can't begin to debug
|
Oh, do we not actually use our .toml file on CI? |
I can confirm locally that setting the However running as |
note that in azure we set |
Might setting |
|
But the latter is the point of |
Ah, sorry, I had it confused with
|
Somehow I get the same error missing either of those two (with |
pyproject.toml
Outdated
|
||
[tool.pytest.ini_options] | ||
minversion = "7.0" | ||
junit_family = "xunit2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default nowadays and can thus be omitted:
https://docs.pytest.org/en/7.1.x/reference/reference.html#confval-junit_family
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so is python_files =test_*py so I'm also gonna omit that
https://docs.pytest.org/en/7.1.x/reference/reference.html#confval-python_files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly.
By default, files matching test_*.py and *_test.py will be considered test modules.
We don't have any *_test.py files under lib
(and only one in the whole project: galleries/examples/units/evans_test.py
). So, effectively, you'll detect the same files when leaving it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't go back in the history, but I'm pretty sure we added python_files
first to avoid running evans_test.py
, but later we added testpaths = lib
, which excluded it in a different manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm +0.05 on leaving python_files =test_*py
to be very explicit what we consider tests. (But OTOH, I likely would not have intoduced it if it was not there).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear, I don't think it needs to stay either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bias is to not have two configurations that we think are doing the same thing cause I think that'll be harder to debug when everything breaks
# Because tests can be run from an installed copy, most of our Pytest | ||
# configuration is in the `pytest_configure` function in | ||
# `lib/matplotlib/testing/conftest.py`. This configuration file exists only to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at least the beginning of this comment is important to preserve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to .toml
remove configs that are now defaults Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
PR summary
Fixes the pytest asserts not showing using @QuLogic 's suggestion of turning on the import-mode=importlib andmoves the contents of pytest.ini into pytest.toml to consolidate since we're not configuring a lot.PR checklist