+def test_remove_with_brackets() -> None:
+ source, expected = read_data("remove_with_brackets")
+ assert_format(
+ source,
+ expected,
+ black.Mode(preview=True),
+ minimum_version=(3, 9),
+ )
+
+
+@pytest.mark.parametrize("filename", PY310_CASES)
+def test_python_310(filename: str) -> None:
+ source, expected = read_data(filename)
+ mode = black.Mode(target_versions={black.TargetVersion.PY310})
+ assert_format(source, expected, mode, minimum_version=(3, 10))
+
+
+def test_python_310_without_target_version() -> None:
+ source, expected = read_data("pattern_matching_simple")
+ mode = black.Mode()
+ assert_format(source, expected, mode, minimum_version=(3, 10))
+
+
+def test_patma_invalid() -> None:
+ source, expected = read_data("pattern_matching_invalid")
+ mode = black.Mode(target_versions={black.TargetVersion.PY310})
+ with pytest.raises(black.parsing.InvalidInput) as exc_info:
+ assert_format(source, expected, mode, minimum_version=(3, 10))
+
+ exc_info.match("Cannot parse: 10:11")
+
+
+@pytest.mark.parametrize("filename", PY311_CASES)
+def test_python_311(filename: str) -> None:
+ source, expected = read_data(filename)
+ mode = black.Mode(target_versions={black.TargetVersion.PY311})
+ assert_format(source, expected, mode, minimum_version=(3, 11))
+
+
+def test_python_2_hint() -> None:
+ with pytest.raises(black.parsing.InvalidInput) as exc_info:
+ assert_format("print 'daylily'", "print 'daylily'")
+ exc_info.match(black.parsing.PY2_HINT)
+
+