diff --git a/test_cases/README.md b/test_cases/README.md index d4baf696eea3..110e8be50735 100644 --- a/test_cases/README.md +++ b/test_cases/README.md @@ -4,6 +4,12 @@ This directory contains regression tests for the stubs found elsewhere in the typeshed repo. Each file contains a number of test cases, all of which should pass a type checker without error. +**This directory should *only* contain tests for functions and classes which +are known to have caused problems in the past, where the stubs are difficult to +get right.** 100% test coverage for typeshed is neither necessary nor +desirable, as it would lead to code duplication. Moreover, typeshed has +multiple other mechanisms for spotting errors in the stubs. + The internal structure of this directory should mimic typeshed as a whole. However, unlike the rest of typeshed, this directory largely contains `.py` files. This is because the purpose of this folder is to test the implications @@ -11,12 +17,6 @@ of typeshed changes for end users. For example, the stub for `builtins.pow` is found in `stdlib/builtins.pyi`, and the regression tests for `pow` are found in `test_cases/stdlib/test_builtins.py`. -100% test coverage for typeshed is neither necessary nor desirable, as it would -lead to unnecessary code duplication. Moreover, typeshed has multiple other -mechanisms for spotting errors in the stubs. As such, this directory should -only contain tests for functions and classes which are known to have caused -problems in the past, where the stubs are difficult to get right. - Note that, unlike elsewhere in typeshed, the test cases in this directory cannot always use modern syntax for type hints. For example, PEP 604 syntax (unions with a pipe `|` operator) is new in Python 3.10. While this syntax can