Skip to content

Commit 8f4131c

Browse files
yjwyjw
authored andcommitted
Make packaging version test release-safe
1 parent 5326eab commit 8f4131c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test_packaging_docs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ def test_package_version_is_next_patch_release():
2121
pyproject = (ROOT / "pyproject.toml").read_text(encoding="utf-8")
2222
init_py = (ROOT / "src" / "young_stock" / "__init__.py").read_text(encoding="utf-8")
2323

24-
assert 'version = "0.2.9"' in pyproject
24+
version = init_py.split('__version__ = "', 1)[1].split('"', 1)[0]
25+
26+
assert f'version = "{version}"' in pyproject
2527
assert 'requires-python = ">=3.9"' in pyproject
2628
assert '"Programming Language :: Python :: 3.9"' in pyproject
27-
assert '__version__ = "0.2.9"' in init_py
29+
assert version.count(".") == 2
2830

2931

3032
def test_pdf_template_is_declared_as_package_data():

0 commit comments

Comments
 (0)