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

Method subTest

Lib/test/test_interpreters/test_lifecycle.py:25–38  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

23
24 @contextlib.contextmanager
25 def subTest(self, *args):
26 with super().subTest(*args) as ctx:
27 self._subtest_count += 1
28 try:
29 yield ctx
30 finally:
31 if self._debugged_in_subtest:
32 if self._subtest_count == 1:
33 # The first subtest adds a leading newline, so we
34 # compensate here by not printing a trailing newline.
35 print('### end subtest debug ###', end='')
36 else:
37 print('### end subtest debug ###')
38 self._debugged_in_subtest = False
39
40 def debug(self, msg, *, header=None):
41 if header:

Calls 1

superClass · 0.85

Tested by

no test coverage detected