Skip to content

Commit

Permalink
Only allow asserts in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adamtheturtle committed Dec 24, 2024
1 parent 9dfce83 commit fa84893
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
requires_python = project_metadata["Requires-Python"]
specifiers = SpecifierSet(specifiers=requires_python)
(specifier,) = specifiers
assert specifier.operator == ">="
if specifier.operator != ">=":
msg = (
f"We only support '>=' for Requires-Python, got {specifier.operator}."
)
raise ValueError(msg)
minimum_python_version = specifier.version

language = "en"
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ lint.ignore = [
"D415",
# Ruff warns that this conflicts with the formatter.
"ISC001",
]

lint.per-file-ignores."tests/*.py" = [
# Allow 'assert' as we use it for tests.
"S101",
]
Expand Down Expand Up @@ -301,6 +304,7 @@ exclude_also = [
strict = true
files = [ "." ]
exclude = [ "build" ]
follow_untyped_imports = true

[tool.pyright]
enableTypeIgnoreComments = false
Expand Down

0 comments on commit fa84893

Please sign in to comment.