diff --git a/tests/test_version_regex_no_rev.py b/tests/test_version_regex_no_rev.py index fecd3fb..c370cba 100644 --- a/tests/test_version_regex_no_rev.py +++ b/tests/test_version_regex_no_rev.py @@ -1,13 +1,23 @@ import subprocess +from pathlib import Path import conftest -from pathlib import Path from nix_update import main + def test_main(helpers: conftest.Helpers) -> None: with helpers.testpkgs(init_git=True) as path: - main(["--file", str(path), "--commit", "net-news-wire", "--version-regex", "^mac-(\\d+\\.\\d+\\.\\d+)$"]) + main( + [ + "--file", + str(path), + "--commit", + "net-news-wire", + "--version-regex", + "^mac-(\\d+\\.\\d+\\.\\d+)$", + ] + ) version = get_nix_value(path, "net-news-wire.version") src = get_nix_value(path, "net-news-wire.src") commit = subprocess.run( @@ -22,6 +32,7 @@ def test_main(helpers: conftest.Helpers) -> None: assert version in commit assert "net-news-wire: 6.1.5 ->" in commit + def get_nix_value(path: Path, key: str) -> str: return subprocess.run( [ diff --git a/tests/testpkgs/net-news-wire.nix b/tests/testpkgs/net-news-wire.nix index 102a3b8..d9eaf4d 100644 --- a/tests/testpkgs/net-news-wire.nix +++ b/tests/testpkgs/net-news-wire.nix @@ -1,7 +1,6 @@ { stdenvNoCC, fetchurl, - nix-update-script, }: stdenvNoCC.mkDerivation rec {