-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add "Naming convention" to test_cases/README.md
#8521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
test_cases/README.md
Outdated
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. | ||
For example: | ||
- Tests for `gather` defined in `stdlib/asyncio/tasks.pyi` will go into `stdlib/asyncio/test_gather.py` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Tests for `gather` defined in `stdlib/asyncio/tasks.pyi` will go into `stdlib/asyncio/test_gather.py` | |
- Tests for `gather` defined in `stdlib/asyncio/tasks.pyi` will go into `stdlib/asyncio/tasks/test_gather.py` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move it then? https://github.com/python/typeshed/blob/master/test_cases/stdlib/asyncio/test_gather.py
test_cases/README.md
Outdated
Use `test_${thing}.py` naming pattern for individual test files. | ||
For example: | ||
- Tests for `gather` defined in `stdlib/asyncio/tasks.pyi` will go into `stdlib/asyncio/test_gather.py` | ||
- Tests for `ExitStack` defined in `stdlib/contextlib.pyi` will go into `stdlib/test_contextlib.py` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These examples don't show why ExitStack goes into test_contextlib
directly, but pow
doesn't go into test_builtins
. We should add something like "By default, tests go into a test file with the same name as the stub file, prefixed with test_
. For example: test_contextlib. If that file becomes too big, we instead create a directory with files named after individual objects being tested. For example: builtins/test_dict."
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Refs #8520