From 873ff13bb0659a56cfec2e07b464a5f1bf8e722f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20Dagur?= Date: Fri, 3 Mar 2023 00:20:10 +0100 Subject: Duplicate package information for Poetry --- tests/test_metadata.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tests/test_metadata.py') diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 62152f5..c719b4d 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -16,6 +16,15 @@ def get_version_value_cargo(): return parse_version(cargo_toml["package"]["version"]) +def get_version_values_pyproject(): + with open("pyproject.toml", encoding="utf-8") as f: + pyproject_toml = toml.loads(f.read()) + return [ + parse_version(pyproject_toml["project"]["version"]), + parse_version(pyproject_toml["tool"]["poetry"]["version"]), + ] + + def get_version_value_changelog(): """ Try to get the names of all classes that we added to the Python module @@ -37,15 +46,18 @@ def get_version_value_changelog(): def test_version_numbers_all_same(): """ - Makes sure that `Cargo.toml` and `CHANGELOG.md` contain the same version - number as the one attached to the `adblock` module. + Makes sure that `pyproject.toml`, `Cargo.toml` and `CHANGELOG.md` contain + the same version number as the one attached to the `adblock` module. """ cargo_version = get_version_value_cargo() changelog_version = get_version_value_changelog() + pyproject_versions = get_version_values_pyproject() module_version = parse_version(adblock.__version__) assert cargo_version == module_version assert module_version == changelog_version + assert changelog_version == pyproject_versions[0] + assert pyproject_versions[0] == pyproject_versions[1] def get_current_python_version(): -- cgit v1.2.3