mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-27 19:49:18 +01:00
Some checks are pending
file length / file-length (push) Waiting to run
kuhy_credit drift / drift (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
palette drift / palette (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
shared gate tests / gate unit tests (push) Waiting to run
Bug-class-check: devstats/tests/test_no_stdlib_shadow.py Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
18 lines
504 B
Python
18 lines
504 B
Python
"""No devstats module may share a stdlib module's name.
|
|
|
|
`python -m devstats` run from inside `devstats/` puts that dir first on
|
|
sys.path, so a `devstats/html.py` replaced the stdlib `html` for every import.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
PACKAGE = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def test_no_module_shadows_the_stdlib() -> None:
|
|
clashes = sorted(p.name for p in PACKAGE.glob("*.py") if p.stem in sys.stdlib_module_names)
|
|
assert clashes == []
|