Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5fdcc4f

Browse files
committed
Fix broken version handling in test suite
1 parent50b2ddb commit5fdcc4f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

‎tests/test_metadata.py‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
importadblock
66

77

8+
defparse_version(version):
9+
parts=version.split(".")
10+
returntuple(map(int,parts))
11+
12+
813
defget_version_value_cargo():
914
withopen("Cargo.toml",encoding="utf-8")asf:
1015
cargo_toml=toml.loads(f.read())
11-
returncargo_toml["package"]["version"]
16+
returnparse_version(cargo_toml["package"]["version"])
1217

1318

1419
defget_version_value_changelog():
@@ -25,7 +30,7 @@ def get_version_value_changelog():
2530
line.strip(),
2631
)
2732
ifmatchisnotNone:
28-
versions.append(match.group(1))
33+
versions.append(parse_version(match.group(1)))
2934
assertversions==sorted(versions,reverse=True)
3035
returnversions[0]
3136

@@ -37,14 +42,14 @@ def test_version_numbers_all_same():
3742
"""
3843
cargo_version=get_version_value_cargo()
3944
changelog_version=get_version_value_changelog()
40-
module_version=adblock.__version__
45+
module_version=parse_version(adblock.__version__)
4146

4247
assertcargo_version==module_version
4348
assertmodule_version==changelog_version
4449

4550

4651
defget_current_python_version():
47-
returnf"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
52+
return(sys.version_info.major,sys.version_info.minor,sys.version_info.micro)
4853

4954

5055
deftest_required_python_version():
@@ -58,4 +63,4 @@ def test_required_python_version():
5863
required_python=cargo_toml["package"]["metadata"]["maturin"]["requires-python"]
5964
assertrequired_python.startswith(">=")
6065
required_python=required_python[2:]
61-
assertget_current_python_version()>=required_python
66+
assertget_current_python_version()>=parse_version(required_python)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp