Skip to content

Commit 0488436

Browse files
committed
test_expand: Add example for annotated assignment without value
1 parent 15af535 commit 0488436

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

setuptools/tests/config/test_expand.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,17 @@ def test_read_attr(self, tmp_path, monkeypatch):
8585
values = expand.read_attr('lib.mod.VALUES', {'lib': 'pkg/sub'}, tmp_path)
8686
assert values['c'] == (0, 1, 1)
8787

88-
def test_read_annotated_attr(self, tmp_path):
88+
@pytest.mark.parametrize(
89+
"example",
90+
[
91+
"VERSION: str\nVERSION = '0.1.1'\nraise SystemExit(1)\n",
92+
"VERSION: str = '0.1.1'\nraise SystemExit(1)\n",
93+
]
94+
)
95+
def test_read_annotated_attr(self, tmp_path, example):
8996
files = {
9097
"pkg/__init__.py": "",
91-
"pkg/sub/__init__.py": (
92-
"VERSION: str = '0.1.1'\n"
93-
"raise SystemExit(1)\n"
94-
),
98+
"pkg/sub/__init__.py": example,
9599
}
96100
write_files(files, tmp_path)
97101
# Make sure this attribute can be read statically

0 commit comments

Comments
 (0)