Skip to content

Commit

Permalink
Make 'DO NOT ADD STUPID TESTS' notice more prominent
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Apr 19, 2022
1 parent 9d3650f commit b2e59b5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test_cases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ 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
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
Expand Down

0 comments on commit b2e59b5

Please sign in to comment.