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

Method test_unreachable_code

Lib/test/test_patma.py:3489–3500  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3487 self.assertListEqual(self._trace(f, "spam"), [1, 2, 3])
3488
3489 def test_unreachable_code(self):
3490 def f(command): # 0
3491 match command: # 1
3492 case 1: # 2
3493 if False: # 3
3494 return 1 # 4
3495 case _: # 5
3496 if False: # 6
3497 return 0 # 7
3498
3499 self.assertListEqual(self._trace(f, 1), [1, 2, 3])
3500 self.assertListEqual(self._trace(f, 0), [1, 2, 5, 6])
3501
3502 @support.skip_wasi_stack_overflow()
3503 def test_parser_deeply_nested_patterns(self):

Callers

nothing calls this directly

Calls 2

_traceMethod · 0.95
assertListEqualMethod · 0.80

Tested by

no test coverage detected