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

Trim "mypy/tests/testX.py::XDataSuite::" from test items #15260

Open
ikonst opened this issue May 17, 2023 · 0 comments
Open

Trim "mypy/tests/testX.py::XDataSuite::" from test items #15260

ikonst opened this issue May 17, 2023 · 0 comments
Labels
feature topic-developer Issues relevant to mypy developers topic-tests

Comments

@ikonst
Copy link
Contributor

ikonst commented May 17, 2023

We can rewrite test collection so that e.g. test-data/unit/check-abstract.test is deemed the test node, rather than mypy/test/testcheck.py::CheckTestSuite::check-abstract.test. This would improve the ergonomics of test invocation, so that one could simply invoke e.g.

pytest test-data/unit/check-abstract.test

Technically, we'd follow the recipe in Working with non-python tests. Each data suite would implement a pytest_collect_file. However, it would also mean we'd need a "registry" of all data suites, since the collection mechanism would need to "ask" all data suites whether they handle the file (in some cases, multiple data suites could each emit items for the same file & test -- see test_name_suffix).

The non-data-suite tests (e.g. those deriving from TestCase) would remain unaffected.

@ikonst ikonst added the feature label May 17, 2023
@AlexWaygood AlexWaygood added topic-developer Issues relevant to mypy developers topic-tests labels May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-developer Issues relevant to mypy developers topic-tests
Projects
None yet
Development

No branches or pull requests

2 participants