Skip to content

Commit bd4ffad

Browse files
committed
Fix failing critieria -> minimum_python_version was altering input value, leading to issues with artifact retrieval
1 parent 3fc89aa commit bd4ffad

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

exasol/toolbox/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ def minimum_python_version(self) -> str:
6060
This is used in specific testing scenarios where it would be either
6161
costly to run the tests for all `python_versions` or we need a single metric.
6262
"""
63-
return str(min([Version.from_string(v) for v in self.python_versions]))
63+
versioned = [Version.from_string(v) for v in self.python_versions]
64+
min_version = min(versioned)
65+
index_min_version = versioned.index(min_version)
66+
return self.python_versions[index_min_version]
6467

6568
@computed_field # type: ignore[misc]
6669
@property

test/unit/config_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def test_expansion_validation_fails_for_invalid_version():
5858

5959

6060
def test_minimum_python_version():
61-
conf = BaseConfig(python_versions=("5.5.5", "1.1.1", "9.9.9"))
62-
assert conf.minimum_python_version == "1.1.1"
61+
conf = BaseConfig(python_versions=("5.5.5", "1.10", "9.9.9"))
62+
assert conf.minimum_python_version == "1.10"
6363

6464

6565
@pytest.mark.parametrize("minimum_python_version", ["3.10", "3.10.5"])

0 commit comments

Comments
 (0)