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

Function test_exc

Lib/test/test_format.py:71–87  ·  view source on GitHub ↗
(formatstr, args, exception, excmsg)

Source from the content-addressed store, hash-verified

69 testformat(ba_format, args, ba_output, limit, overflowok)
70
71def test_exc(formatstr, args, exception, excmsg):
72 try:
73 testformat(formatstr, args)
74 except exception as exc:
75 if str(exc) == excmsg:
76 if verbose:
77 print("yes")
78 else:
79 if verbose: print('no')
80 print('Unexpected ', exception, ':', repr(str(exc)))
81 raise
82 except:
83 if verbose: print('no')
84 print('Unexpected exception')
85 raise
86 else:
87 raise TestFailed('did not get expected exception: %s' % excmsg)
88
89def test_exc_common(formatstr, args, exception, excmsg):
90 # test str and bytes

Callers 3

test_exc_commonFunction · 0.85
test_str_formatMethod · 0.85

Calls 3

TestFailedClass · 0.90
testformatFunction · 0.85
strFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…