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

Method test_reset_redefine

IPython/core/tests/test_magic.py:376–397  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

374class TestResetErrors(TestCase):
375
376 def test_reset_redefine(self):
377
378 @magics_class
379 class KernelMagics(Magics):
380 @line_magic
381 def less(self, shell): pass
382
383 _ip.register_magics(KernelMagics)
384
385 with self.assertLogs() as cm:
386 # hack, we want to just capture logs, but assertLogs fails if not
387 # logs get produce.
388 # so log one things we ignore.
389 import logging as log_mod
390 log = log_mod.getLogger()
391 log.info('Nothing')
392 # end hack.
393 _ip.run_cell("reset -f")
394
395 assert len(cm.output) == 1
396 for out in cm.output:
397 assert "Invalid alias" not in out
398
399def test_tb_syntaxerror():
400 """test %tb after a SyntaxError"""

Callers

nothing calls this directly

Calls 2

infoMethod · 0.80
run_cellMethod · 0.45

Tested by

no test coverage detected