MCPcopy Index your code
hub / github.com/python/cpython / expect_parsing_failure

Method expect_parsing_failure

Lib/test/test_clinic.py:790–795  ·  view source on GitHub ↗
(
        self, *, filename, expected_error, verify=True, output=None
    )

Source from the content-addressed store, hash-verified

788
789class ParseFileUnitTest(TestCase):
790 def expect_parsing_failure(
791 self, *, filename, expected_error, verify=True, output=None
792 ):
793 errmsg = re.escape(dedent(expected_error).strip())
794 with self.assertRaisesRegex(ClinicError, errmsg):
795 parse_file(filename, limited_capi=False)
796
797 def test_parse_file_no_extension(self) -> None:
798 self.expect_parsing_failure(

Calls 5

dedentFunction · 0.90
parse_fileFunction · 0.90
escapeMethod · 0.80
assertRaisesRegexMethod · 0.80
stripMethod · 0.45

Tested by

no test coverage detected