Description
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.