MCPcopy Index your code
hub / github.com/ipython/ipython / test_reset_redefine

Method test_reset_redefine

tests/test_magic.py:387–409  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

385
386class TestResetErrors(TestCase):
387 def test_reset_redefine(self):
388 @magics_class
389 class KernelMagics(Magics):
390 @line_magic
391 def less(self, shell):
392 pass
393
394 _ip.register_magics(KernelMagics)
395
396 with self.assertLogs() as cm:
397 # hack, we want to just capture logs, but assertLogs fails if not
398 # logs get produce.
399 # so log one things we ignore.
400 import logging as log_mod
401
402 log = log_mod.getLogger()
403 log.info("Nothing")
404 # end hack.
405 _ip.run_cell("reset -f")
406
407 assert len(cm.output) == 1
408 for out in cm.output:
409 assert "Invalid alias" not in out
410
411
412def test_tb_syntaxerror():

Callers

nothing calls this directly

Calls 2

infoMethod · 0.80
run_cellMethod · 0.45

Tested by

no test coverage detected