MCPcopy Index your code
hub / github.com/pytorch/pytorch / test_exception

Method test_exception

caffe2/python/python_op_test.py:55–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 workspace.RunOperatorOnce(op)
54
55 def test_exception(self):
56 op = CreatePythonOperator(MainOpFunctionThatThrowsCustomError, [], [])
57 with self.assertRaisesRegex(CustomError, "This is an intentional exception."):
58 workspace.RunOperatorOnce(op)
59
60 def test_exception_builder(self):
61 op = CreatePythonOperator(MainOpFunctionThatThrowsCustomErrorInBuilder, [], [])

Callers

nothing calls this directly

Calls 2

CreatePythonOperatorFunction · 0.90
assertRaisesRegexMethod · 0.80

Tested by

no test coverage detected