Centralize METADATA.toml parsing in the test suite#9534
Centralize METADATA.toml parsing in the test suite#9534AlexWaygood merged 10 commits intopython:mainfrom
Conversation
| @@ -162,46 +130,8 @@ def _find_stdlib_modules() -> set[str]: | |||
|
|
|||
| def check_metadata() -> None: | |||
There was a problem hiding this comment.
At this point, this feels redundant since other tests will fail anyway. 😅
Unless you wanna use it as a smoke test.
There was a problem hiding this comment.
I get what you mean, but the other tests will assert the correctness of the METADATA.toml files "by accident". I feel like it's useful to have a test that asserts the correctness of the METADATA.toml files "on purpose"? That way we still have this guaranteed to be tested in CI, even if some other tests no longer need to get stuff from METADATA.toml files in the future, for whatever reason.
There was a problem hiding this comment.
Yeah that's what I meant by a smoke test (an easy test that says, if this fails, everything else will fail anyway, so it's easy to find the source of the error). Just wanted to know if it was on purpose :)
|
What about the |
I believe that if somebody did try to add a per-stub config section for mypy, |
This reverts commit c216b74.
We have various bits of logic scattered across the test suite to parse METADATA.toml files. This is a bug magnet: see e.g. #9532 (comment). (Failing CI run here: https://github.com/python/typeshed/actions/runs/3918898414/jobs/6699564673.) By centralizing the logic all in one place, we reduce the risk of bugs in our tests, and also improve type safety.
This PR centralizes METADATA.toml-parsing logic into a new file,
tests/parse_metadata.py.