From c3a64b44b7ab8742f4fe3630cd9751104d9f78d2 Mon Sep 17 00:00:00 2001 From: David Peter Date: Fri, 13 Dec 2024 10:40:38 +0100 Subject: [PATCH] [red-knot] mdtest: python version requirements (#14954) ## Summary This is not strictly required yet, but makes these tests future-proof. They need a `python-version` requirement as they rely on language features that are not available in 3.9. --- .../resources/mdtest/exception/except_star.md | 7 +++++++ .../mdtest/{type_alias.md => pep695_type_aliases.md} | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) rename crates/red_knot_python_semantic/resources/mdtest/{type_alias.md => pep695_type_aliases.md} (90%) diff --git a/crates/red_knot_python_semantic/resources/mdtest/exception/except_star.md b/crates/red_knot_python_semantic/resources/mdtest/exception/except_star.md index 062e285c46..b64f6f4e64 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/exception/except_star.md +++ b/crates/red_knot_python_semantic/resources/mdtest/exception/except_star.md @@ -1,5 +1,12 @@ # `except*` +`except*` is only available in Python 3.11 and later: + +```toml +[environment] +python-version = "3.11" +``` + ## `except*` with `BaseException` ```py diff --git a/crates/red_knot_python_semantic/resources/mdtest/type_alias.md b/crates/red_knot_python_semantic/resources/mdtest/pep695_type_aliases.md similarity index 90% rename from crates/red_knot_python_semantic/resources/mdtest/type_alias.md rename to crates/red_knot_python_semantic/resources/mdtest/pep695_type_aliases.md index 77a9441136..de2eccf81e 100644 --- a/crates/red_knot_python_semantic/resources/mdtest/type_alias.md +++ b/crates/red_knot_python_semantic/resources/mdtest/pep695_type_aliases.md @@ -1,4 +1,11 @@ -# Type aliases +# PEP 695 type aliases + +PEP 695 type aliases are only available in Python 3.12 and later: + +```toml +[environment] +python-version = "3.12" +``` ## Basic