"tupleassign",
]
-EXPERIMENTAL_STRING_PROCESSING_CASES: List[str] = [
- "cantfit",
- "comments7",
- "long_strings",
- "long_strings__edge_case",
- "long_strings__regression",
- "percent_precedence",
-]
-
PY310_CASES: List[str] = [
"pattern_matching_simple",
"pattern_matching_complex",
"parenthesized_context_managers",
]
-PREVIEW_CASES: List[str] = []
+PREVIEW_CASES: List[str] = [
+ # string processing
+ "cantfit",
+ "comments7",
+ "long_strings",
+ "long_strings__edge_case",
+ "long_strings__regression",
+ "percent_precedence",
+]
SOURCES: List[str] = [
"src/black/__init__.py",
check_file(filename, DEFAULT_MODE)
-@pytest.mark.parametrize("filename", EXPERIMENTAL_STRING_PROCESSING_CASES)
-def test_experimental_format(filename: str) -> None:
- check_file(filename, black.Mode(experimental_string_processing=True))
-
-
@pytest.mark.parametrize("filename", PREVIEW_CASES)
def test_preview_format(filename: str) -> None:
check_file(filename, black.Mode(preview=True))
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})
exc_info.match("Cannot parse: 10:11")
-def test_patma_hint() -> None:
- source, expected = read_data("pattern_matching_simple")
- mode = black.Mode(target_versions={black.TargetVersion.PY39})
- with pytest.raises(black.parsing.InvalidInput) as exc_info:
- assert_format(source, expected, mode, minimum_version=(3, 10))
-
- exc_info.match(black.parsing.PY310_HINT)
-
-
def test_python_2_hint() -> None:
with pytest.raises(black.parsing.InvalidInput) as exc_info:
assert_format("print 'daylily'", "print 'daylily'")