Skip to content

Commit a5ab7c1

Browse files
committed
config: reject minversion if it's a list instead of a single string
Fixes: src/_pytest/config/__init__.py:1071: error: Argument 1 to "Version" has incompatible type "Union[str, List[str]]"; expected "str" [arg-type]
1 parent 1cf9405 commit a5ab7c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/_pytest/config/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,11 @@ def _checkversion(self):
10671067
# Imported lazily to improve start-up time.
10681068
from packaging.version import Version
10691069

1070+
if not isinstance(minver, str):
1071+
raise pytest.UsageError(
1072+
"%s: 'minversion' must be a single value" % self.inifile
1073+
)
1074+
10701075
if Version(minver) > Version(pytest.__version__):
10711076
raise pytest.UsageError(
10721077
"%s: 'minversion' requires pytest-%s, actual pytest-%s'"

0 commit comments

Comments
 (0)