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

meta tests: refactor run_pytest #15481

Merged

Conversation

ikonst
Copy link
Contributor

@ikonst ikonst commented Jun 20, 2023

Factor run_pytest out of mypy/test/meta/test_*.py.

Also, prefixing the nested pytest output so it's harder to mix it up with parent pytest's:

>> .../mypy/venv/bin/python -m pytest -n 0 -s mypy/test/testcheck.py::TypeCheckSuite::check-meta-909158d4-c9c7-41e6-be50-cf101aaa2b56.test
NESTED PYTEST STDOUT: ============================= test session starts ==============================
                    : platform darwin -- Python 3.11.3, pytest-7.3.1, pluggy-1.0.0
                    : rootdir: .../mypy

@ikonst ikonst force-pushed the 06-20-meta_tests_refactor_run_pytest branch 2 times, most recently from efaa570 to 632c88b Compare June 20, 2023 15:58
@ikonst ikonst force-pushed the 06-20-meta_tests_refactor_run_pytest branch from 632c88b to b481b33 Compare June 20, 2023 21:52
@ikonst ikonst force-pushed the 06-20-meta_tests_refactor_run_pytest branch from c08848a to f00a623 Compare August 13, 2023 02:51
@ikonst
Copy link
Contributor Author

ikonst commented Aug 13, 2023

@hauntsaninja

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Looks good, one nit!


test_nodeid = f"{pytest_node_prefix}::{p.name}"
extra_args = [sys.executable, "-m", "pytest", "-n", "0", "-s", *extra_args, test_nodeid]
if sys.version_info >= (3, 8):
Copy link
Collaborator

Choose a reason for hiding this comment

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

We've dropped support for 3.7 :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

b0083b0 but we should maybe enable https://beta.ruff.rs/docs/rules/outdated-version-block/ and perhaps more "pyupgrade" rules? (in a separate PR)

@hauntsaninja hauntsaninja merged commit 6a6d2e8 into python:master Sep 2, 2023
12 checks passed
@ikonst ikonst mentioned this pull request Sep 2, 2023
hauntsaninja pushed a commit that referenced this pull request Sep 3, 2023
For example, this [review
comment](#15481 (comment))
could've been spared with
[UP036](https://beta.ruff.rs/docs/rules/outdated-version-block/).
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