From f7aa7b709a826ed34f52b1de3f7095f90f349a9c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sun, 29 Oct 2023 11:07:17 +0100 Subject: [PATCH] Improve regression test documentation (#10935) Co-authored-by: Alex Waygood --- test_cases/README.md | 7 +++++++ tests/README.md | 3 ++- tests/regr_test.py | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test_cases/README.md b/test_cases/README.md index b154c0d2e..5624290a5 100644 --- a/test_cases/README.md +++ b/test_cases/README.md @@ -32,6 +32,13 @@ stubs where decisions have been taken that might be slightly unusual. These test cases serve a different purpose: to check that type checkers do not emit false-positive errors for idiomatic usage of these classes. +## Running the tests + +To verify the test cases in this directory pass with mypy, run `python tests/regr_test.py stdlib` +from the root of the typeshed repository. This assumes that the development +environment has been set up as described in the [CONTRIBUTING.md](../CONTRIBUTING.md) +document. + ### How the tests work The code in this directory is not intended to be directly executed. Instead, diff --git a/tests/README.md b/tests/README.md index ccef075e2..47437c599 100644 --- a/tests/README.md +++ b/tests/README.md @@ -104,7 +104,8 @@ the stubs in typeshed (including the standard library). ## regr\_test.py This test runs mypy against the test cases for typeshed's stdlib and third-party -stubs. See the README in the `test_cases` directory for more information about what +stubs. See [the README in the `test_cases` directory](../test_cases/README.md) +for more information about what these test cases are for and how they work. Run `python tests/regr_test.py --help` for information on the various configuration options. diff --git a/tests/regr_test.py b/tests/regr_test.py index aaface2fc..cc7ede290 100755 --- a/tests/regr_test.py +++ b/tests/regr_test.py @@ -69,7 +69,10 @@ parser.add_argument( type=package_with_test_cases, nargs="*", action="extend", - help="Test only these packages (defaults to all typeshed stubs that have test cases)", + help=( + "Test only these packages (defaults to all typeshed stubs that have test cases). " + 'Use "stdlib" to test the standard library test cases.' + ), ) parser.add_argument( "--all",