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