Skip to content

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

Open
@ikonst

Description

@ikonst

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions