Skip to content
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

Add stdlib/@tests? #11762

Closed
srittau opened this issue Apr 14, 2024 · 1 comment · Fixed by #11982
Closed

Add stdlib/@tests? #11762

srittau opened this issue Apr 14, 2024 · 1 comment · Fixed by #11982
Labels
project: infrastructure typeshed build, test, documentation, or distribution related

Comments

@srittau
Copy link
Collaborator

srittau commented Apr 14, 2024

There's a slight inconsistency that's been bugging me: Third-party stubs – sensibly – can have a @tests directory, which contains the stubtest allowlists and regression tests. On the other hand, the allowlists for the standard library are in tests/stubtest_allowlists and the test cases in test_cases/stdlib. (The test_cases directory is otherwise empty, except for a README file.) For consistency's sake and easier discoverability, I suggest we add a stdlib/@tests directory with the same structure as the corresponding stubs/*/@tests directories and move the existing files there.

@srittau srittau added the project: infrastructure typeshed build, test, documentation, or distribution related label Apr 14, 2024
@srittau
Copy link
Collaborator Author

srittau commented Apr 14, 2024

Type checker authors would be encouraged to omit that directory from their distributions, although I don't see harm in including it.

srittau added a commit to srittau/typeshed that referenced this issue May 5, 2024
Previously, handling of test directories (`@tests` and `test_cases`) was
distributed over multiple files and redundant. This unifies the handling
in the `utils` module. This also fixes some instances where "package"
was used instead of "distribution". And in a few instances paths were
joined by using a `/` in a string, which is incompatible with Windows.

Also move `runtests.py` from `scripts` to `tests`. This is required so that
we can import `utils`, but it's also arguably the better fit. The only
mention of the script is actually in the `tests/README.md` file.

Helps with python#11762.
srittau added a commit that referenced this issue May 5, 2024
Previously, handling of test directories (`@tests` and `test_cases`) was
distributed over multiple files and redundant. This unifies the handling
in the `utils` module. This also fixes some instances where "package"
was used instead of "distribution". And in a few instances paths were
joined by using a `/` in a string, which is incompatible with Windows.

Also move `runtests.py` from `scripts` to `tests`. This is required so that
we can import `utils`, but it's also arguably the better fit. The only
mention of the script is actually in the `tests/README.md` file.

Helps with #11762.
srittau added a commit to srittau/typeshed that referenced this issue May 10, 2024
This is a preparation for python#11762
JelleZijlstra pushed a commit to python/mypy that referenced this issue May 15, 2024
During the last typehed update, we included the `@tests` folder which is
unnecessary for mypy.
Update the `sync-typeshed.py` script to exclude it in the future.

Refs:
- #17246
- python/typeshed#11762

---------

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
@srittau srittau linked a pull request May 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project: infrastructure typeshed build, test, documentation, or distribution related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant