Skip to content

Commit

Permalink
[out] version checks must be against min version or higher (#15430)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst authored Jun 13, 2023
1 parent 61a7f3b commit 2a89f75
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mypy/test/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import pytest

from mypy import defaults
from mypy.test.config import PREFIX, test_data_prefix, test_temp_dir

root_dir = os.path.normpath(PREFIX)
Expand Down Expand Up @@ -166,6 +167,10 @@ def _item_fail(msg: str) -> NoReturn:
version = tuple(int(x) for x in version_str.split("."))
except ValueError:
_item_fail(f"{version_str!r} is not a valid python version")
if version < defaults.PYTHON3_VERSION:
_item_fail(
f"Version check against {version}; must be >= {defaults.PYTHON3_VERSION}"
)
if compare_op == ">=":
version_check = sys.version_info >= version
elif compare_op == "==":
Expand Down

0 comments on commit 2a89f75

Please sign in to comment.