MCPcopy Create free account
hub / github.com/pexpect/pexpect / assertRaises

Method assertRaises

tests/PexpectTestCase.py:99–105  ·  view source on GitHub ↗
(self, excClass)

Source from the content-addressed store, hash-verified

97 # removed when we drop Python 2.6 support.
98 @contextlib.contextmanager
99 def assertRaises(self, excClass):
100 try:
101 yield
102 except Exception as e:
103 assert isinstance(e, excClass)
104 else:
105 raise AssertionError("%s was not raised" % excClass)
106
107 @contextlib.contextmanager
108 def assertRaisesRegex(self, excClass, pattern):

Callers 13

test_eofMethod · 0.80
test_timeoutMethod · 0.80
test_eofMethod · 0.80
test_timeoutMethod · 0.80
test_not_intMethod · 0.80
test_decoding_errorsMethod · 0.80
test_no_bytesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected