utils/devstats/tests/test_no_stdlib_shadow.py
Krzysztof kuhy Rudnicki 593283d240
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
devstats: rename html.py, it shadowed stdlib
Bug-class-check: devstats/tests/test_no_stdlib_shadow.py

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-27 19:20:52 +01:00

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 == []