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

Method test_aimport_parsing

tests/test_zzz_autoreload.py:595–612  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

593 self.shell.magic_autoreload("4")
594
595 def test_aimport_parsing(self):
596 # Modules can be included or excluded all in one line.
597 module_reloader = self.shell.auto_magics._reloader
598 self.shell.magic_aimport("os") # import and mark `os` for auto-reload.
599 assert module_reloader.modules["os"] is True
600 assert "os" not in module_reloader.skip_modules.keys()
601
602 self.shell.magic_aimport("-math") # forbid autoreloading of `math`
603 assert module_reloader.skip_modules["math"] is True
604 assert "math" not in module_reloader.modules.keys()
605
606 self.shell.magic_aimport(
607 "-os, math"
608 ) # Can do this all in one line; wasn't possible before.
609 assert module_reloader.modules["math"] is True
610 assert "math" not in module_reloader.skip_modules.keys()
611 assert module_reloader.skip_modules["os"] is True
612 assert "os" not in module_reloader.modules.keys()
613
614 def test_autoreload_output(self):
615 self.shell.magic_autoreload("complete")

Callers

nothing calls this directly

Calls 2

magic_aimportMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected