mirror of
https://github.com/Mic92/nix-update.git
synced 2024-09-11 02:25:32 +03:00
improve version assertions in tests
fixes broken tests due to flaky string comparisons
This commit is contained in:
parent
430c441072
commit
2fdb989360
@ -21,7 +21,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
).stdout.strip()
|
||||
assert version >= "8.5.2"
|
||||
assert tuple(map(int, version.split("."))) >= (8, 5, 2)
|
||||
commit = subprocess.run(
|
||||
["git", "-C", path, "log", "-1"],
|
||||
text=True,
|
||||
|
@ -23,7 +23,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
).stdout.strip()
|
||||
assert version >= "30"
|
||||
assert int(version) >= 30
|
||||
commit = subprocess.run(
|
||||
["git", "-C", path, "log", "-1"],
|
||||
text=True,
|
||||
|
@ -23,7 +23,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
).stdout.strip()
|
||||
assert version >= "8.5.2"
|
||||
assert tuple(map(int, version.split("."))) >= (8, 5, 2)
|
||||
commit = subprocess.run(
|
||||
["git", "-C", path, "log", "-1"],
|
||||
text=True,
|
||||
|
@ -23,7 +23,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
).stdout.strip()
|
||||
assert version >= "0.22.0"
|
||||
assert tuple(map(int, version.split("."))) >= (0, 22, 0)
|
||||
commit = subprocess.run(
|
||||
["git", "-C", path, "log", "-1"],
|
||||
text=True,
|
||||
|
@ -23,5 +23,5 @@ def test_update(helpers: conftest.Helpers) -> None:
|
||||
],
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
)
|
||||
assert version.stdout.strip() > "10.8.6"
|
||||
).stdout.strip()
|
||||
assert tuple(map(int, version.split("."))) > (10, 8, 6)
|
||||
|
@ -23,7 +23,7 @@ def test_main(helpers: conftest.Helpers) -> None:
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
).stdout.strip()
|
||||
assert version >= "3.0.1"
|
||||
assert tuple(map(int, version.split("."))) >= (3, 0, 1)
|
||||
commit = subprocess.run(
|
||||
["git", "-C", path, "log", "-1"],
|
||||
text=True,
|
||||
|
@ -23,5 +23,5 @@ def test_update(helpers: conftest.Helpers) -> None:
|
||||
],
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
)
|
||||
assert version.stdout.strip() >= "0.6.8"
|
||||
).stdout.strip()
|
||||
assert tuple(map(int, version.split("."))) >= (0, 6, 8)
|
||||
|
@ -23,5 +23,5 @@ def test_update(helpers: conftest.Helpers) -> None:
|
||||
],
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
)
|
||||
assert version.stdout.strip() >= "0.3.6"
|
||||
).stdout.strip()
|
||||
assert tuple(map(int, version.split("."))) >= (0, 3, 6)
|
||||
|
Loading…
Reference in New Issue
Block a user