MCPcopy
hub / github.com/psf/black / test_patma_invalid

Function test_patma_invalid

tests/test_format.py:86–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84
85
86def test_patma_invalid() -> None:
87 source, expected = read_data("miscellaneous", "pattern_matching_invalid")
88 mode = black.Mode(target_versions={black.TargetVersion.PY310})
89 with pytest.raises(black.parsing.InvalidInput) as exc_info:
90 assert_format(source, expected, mode, minimum_version=(3, 10))
91
92 exc_info.match(
93 re.escape(
94 "Cannot parse for target version Python 3.10: 10:11\n"
95 " case a := b:\n"
96 " ^\n"
97 "ParseError: bad input"
98 )
99 )

Callers

nothing calls this directly

Calls 3

read_dataFunction · 0.90
assert_formatFunction · 0.90
matchMethod · 0.45

Tested by

no test coverage detected