Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* eol=lf
# Set linguist-language to support comments syntax highlight
**/stubtest_allowlist*.txt linguist-language=ini
tests/stubtest_allowlists/*.txt linguist-language=ini
**/stubtest_allowlists/*.txt linguist-language=ini
tests/pytype_exclude_list.txt linguist-language=ini
pyrightconfig*.json linguist-language=jsonc
.vscode/*.json linguist-language=jsonc
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ analyze.py
.python-version

# deliberately local test configuration files
tests/stubtest_allowlists/*.local
stdlib/@tests/stubtest_allowlists/*.local
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@ on your typeshed fork).
As a convenience, stubtest\_stdlib.py will look for local-only allowlist files
and use those if they are present. Only version-specific local allowlists are supported.
An example local allowlist file is
`tests/stubtest_allowlists/py312.txt.local`. Use caution when taking advantage of this feature;
`stdlib/@tests/stubtest_allowlists/py312.txt.local`. Use caution when taking advantage of this feature;
the CI run of stubtest remains canonical.

If you need a specific version of Python to repro a CI failure,
[pyenv](https://github.com/pyenv/pyenv) can also help.

Due to its dynamic nature, you may run into false positives. In this case, you
can add to the allowlists for each affected Python version in
`tests/stubtest_allowlists`. Please file issues for stubtest false positives
`stdlib/@tests/stubtest_allowlists`. Please file issues for stubtest false positives
at [mypy](https://github.com/python/mypy/issues).

## stubtest\_third\_party.py
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ def get_all_testcase_directories() -> list[DistributionTests]:

def allowlists_path(distribution_name: str) -> Path:
if distribution_name == "stdlib":
return Path("tests", "stubtest_allowlists")
return tests_path("stdlib") / "stubtest_allowlists"
else:
return tests_path(distribution_name)


def common_allowlists(distribution_name: str) -> list[str]:
if distribution_name == "stdlib":
return ["py3_common.txt", f"{sys.platform}.txt"]
return ["common.txt", f"{sys.platform}.txt"]
else:
return ["stubtest_allowlist.txt", f"stubtest_allowlist_{sys.platform}.txt"]

Expand Down