Skip to content

Commit a6d3a4e

Browse files
committed
This should also work for Python 3.10 and 3.11
For Python 3.10 and 3.11 a "hatch run test.py3.11:pytest -vv test/test_utility/test_sourceparams.py" yielded " FAILED test/test_utility/test_sourceparams.py::test_sourceparams_descriptions_complete - TypeError: unsupported operand type(s) for 'in': 'str' and 'EnumType' " With these changes all four Python versions should pass.
1 parent 542848c commit a6d3a4e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/test_utility/test_sourceparams.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55

66

77
def test_sourceparams_descriptions_complete():
8+
source_parameters = {p.value for p in SourceParams}
9+
description_keys = source_params_descriptions.keys()
10+
11+
missing = source_parameters - description_keys
12+
extra = description_keys - source_parameters
13+
814
# Ensure that all source parameters have a description.
9-
assert all(p.value in source_params_descriptions for p in SourceParams)
15+
assert not missing, f"Missing descriptions for: {sorted(missing)}"
16+
1017
# And assert that all descriptions correspond to a source parameter.
11-
assert all(p in SourceParams for p in source_params_descriptions)
18+
assert not extra, f"Descriptions for unknown params: {sorted(extra)}"

0 commit comments

Comments
 (0)