MCPcopy Create free account
hub / github.com/pytorch/pytorch / assertParseErrorInline

Method assertParseErrorInline

tools/test/test_codegen_model.py:23–32  ·  view source on GitHub ↗
(self, yaml_str: str, expect: str)

Source from the content-addressed store, hash-verified

21
22class TestCodegenModel(expecttest.TestCase):
23 def assertParseErrorInline(self, yaml_str: str, expect: str) -> None:
24 es = yaml.load(yaml_str, Loader=LineLoader)
25 try:
26 parse_native_yaml_struct(es, set())
27 except AssertionError as e:
28 # hack to strip out the context
29 msg, _ = str(e).split(" in ", 2)
30 self.assertExpectedInline("\n".join(textwrap.wrap(msg)), expect, skip=1)
31 return
32 self.fail(msg="Did not raise when expected to")
33
34 def assertUfuncErrorInline(self, yaml_str: str, expect: str) -> None:
35 # parse a single structured group out of the yaml to g

Calls 7

parse_native_yaml_structFunction · 0.90
assertExpectedInlineMethod · 0.80
loadMethod · 0.45
splitMethod · 0.45
joinMethod · 0.45
wrapMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected