From d53d3258b210c29aa6f102cf8336c5fd56f922fc Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sat, 13 Aug 2022 06:15:23 +0300 Subject: [PATCH] Add "Naming convention" to `test_cases/README.md` (#8521) Co-authored-by: Jelle Zijlstra --- test_cases/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test_cases/README.md b/test_cases/README.md index 42ae0c373..d15382e15 100644 --- a/test_cases/README.md +++ b/test_cases/README.md @@ -52,6 +52,17 @@ annotations, [this page](https://typing.readthedocs.io/en/latest/source/quality.html#testing-using-assert-type-and-warn-unused-ignores) provides a useful guide. +### Naming convention + +Use the same top-level name for the module / package you would like to test. +Use `test_${thing}.py` naming pattern for individual test files. + +By default, tests go into a test file with the same name as the stub file, prefixed with `test_`. +For example: `stdlib/test_contextlib.py`. + +If that file becomes too big, we instead create a directory with files named after individual objects being tested. +For example: `stdlib/builtins/test_dict.py`. + ### Differences to the rest of typeshed Unlike the rest of typeshed, this directory largely contains `.py` files. This