MCPcopy Create free account
hub / github.com/ipython/ipython / test_command_chain_dispatcher_ff

Function test_command_chain_dispatcher_ff

IPython/core/tests/test_hooks.py:39–54  ·  view source on GitHub ↗

Test two failing hooks

()

Source from the content-addressed store, hash-verified

37#-----------------------------------------------------------------------------
38
39def test_command_chain_dispatcher_ff():
40 """Test two failing hooks"""
41 fail1 = Fail(u'fail1')
42 fail2 = Fail(u'fail2')
43 dp = CommandChainDispatcher([(0, fail1),
44 (10, fail2)])
45
46 try:
47 dp()
48 except TryNext as e:
49 nt.assert_equal(str(e), u'fail2')
50 else:
51 assert False, "Expected exception was not raised."
52
53 nt.assert_true(fail1.called)
54 nt.assert_true(fail2.called)
55
56def test_command_chain_dispatcher_fofo():
57 """Test a mixture of failing and succeeding hooks."""

Callers

nothing calls this directly

Calls 2

FailClass · 0.85

Tested by

no test coverage detected