Skip to content

Commit b4f25c8

Browse files
committed
Only allow assert in tests
1 parent 8b5a689 commit b4f25c8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs/source/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646
requires_python = project_metadata["Requires-Python"]
4747
specifiers = SpecifierSet(specifiers=requires_python)
4848
(specifier,) = specifiers
49-
assert specifier.operator == ">="
49+
if specifier.operator != ">=":
50+
msg = (
51+
f"We only support '>=' for Requires-Python, got {specifier.operator}."
52+
)
53+
raise ValueError(msg)
5054
minimum_python_version = specifier.version
5155

5256
language = "en"

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ lint.ignore = [
123123
# Ignore "too-many-*" errors as they seem to get in the way more than
124124
# helping.
125125
"PLR0913",
126-
# Allow 'assert' as we use it for tests.
126+
]
127+
128+
lint.per-file-ignores."tests/*.py" = [
129+
# Do not require tests to have a one-line summary.
127130
"S101",
128131
]
129132

0 commit comments

Comments
 (0)