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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ envs.docs.scripts.clean = "git clean -fdX -- {args:docs}"
envs.hatch-test.dependency-groups = [ "dev", "test" ]
envs.hatch-test.matrix = [
# Test the lowest and highest supported Python versions with normal deps
{ deps = [ "stable" ], python = [ "3.12", "3.14" ] },
{ deps = [ "stable" ], python = [ "3.12", "3.13", "3.14" ] },
# Test the newest supported Python version also with pre-release deps
{ deps = [ "pre" ], python = [ "3.14" ] },
]
Expand Down
7 changes: 4 additions & 3 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,22 @@ def test_override_docs(docstring_style: Literal["google", "numpy"], settings: Du
("attr", "expected"),
[
pytest.param("string", "str", id="builtin"),
pytest.param("path", "pathlib.Path", id="3rd-party"),
pytest.param("pattern", "re.Pattern[str]", id="import"),
# same module as `S`, so no leading `tests.test_settings.`
pytest.param("local", "test_annotation_format.<locals>.Local", id="same-module"),
],
)
def test_annotation_format(attr: str, expected: str) -> None:
"""Test that annotation references work correctly."""
import re

class Local: ...

class S(Settings, exported_object_name="s", docstring_style="google"):
if attr == "string":
string: str
if attr == "path":
path: Path
if attr == "pattern":
pattern: re.Pattern[str]
if attr == "local":
local: Local

Expand Down
Loading