Skip to content

Commit d53d325

Browse files
Add "Naming convention" to test_cases/README.md (#8521)
Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent cf0b3a2 commit d53d325

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test_cases/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ annotations,
5252
[this page](https://typing.readthedocs.io/en/latest/source/quality.html#testing-using-assert-type-and-warn-unused-ignores)
5353
provides a useful guide.
5454

55+
### Naming convention
56+
57+
Use the same top-level name for the module / package you would like to test.
58+
Use `test_${thing}.py` naming pattern for individual test files.
59+
60+
By default, tests go into a test file with the same name as the stub file, prefixed with `test_`.
61+
For example: `stdlib/test_contextlib.py`.
62+
63+
If that file becomes too big, we instead create a directory with files named after individual objects being tested.
64+
For example: `stdlib/builtins/test_dict.py`.
65+
5566
### Differences to the rest of typeshed
5667

5768
Unlike the rest of typeshed, this directory largely contains `.py` files. This

0 commit comments

Comments
 (0)