Skip to content

Apply mypy-tests custom config to other mypy-based tests #13825

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Apr 14, 2025

Extracted from #13627
Also relates to #12178 and #8403

We have the infra/tooling in place for per-stub mypy configuration. But those configs didn't extend to other tests, making it unusable since stubtest would still fail.

Easier with review with whitespace changes hidden.

Comment on lines 54 to 57
@contextmanager
def temporary_mypy_config_file(
configurations: Iterable[MypyDistConf],
) -> Generator[tempfile._TemporaryFileWrapper[str]]: # pyright: ignore[reportPrivateUsage]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a full review, but I'd prefer to keep the temporary file workaround logic separate from the actual logic for the temporary files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah sure that makes sense. We may have to reuse temporary files elsewhere. It'd be nice if already separate.

The workaround used to only be done in tests/mypy_test.py, but I'll extract it and put it somewhere in ts_lib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants