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

Function test_ignore_module_basic_functionality

tests/test_debugger.py:674–737  ·  view source on GitHub ↗

Test basic ignore/unignore functionality and error handling.

()

Source from the content-addressed store, hash-verified

672
673@skip_win32
674def test_ignore_module_basic_functionality():
675 """Test basic ignore/unignore functionality and error handling."""
676 import pexpect
677
678 env = os.environ.copy()
679 env["IPY_TEST_SIMPLE_PROMPT"] = "1"
680
681 with TemporaryDirectory() as temp_dir:
682 main_path = create_test_modules(temp_dir)
683
684 child = pexpect.spawn(sys.executable, [main_path], env=env, cwd=temp_dir)
685 child.timeout = 15 * IPYTHON_TESTING_TIMEOUT_SCALE
686 child.expect("ipdb>")
687
688 # Test listing modules when none are ignored
689 child.sendline("ignore_module")
690 child.expect_exact("No modules are currently ignored.")
691 child.expect("ipdb>")
692
693 # Test ignoring a module
694 child.sendline("ignore_module level2_module")
695 child.expect("ipdb>")
696
697 # Test listing ignored modules
698 child.sendline("ignore_module")
699 child.expect_exact("Currently ignored modules: ['level2_module']")
700 child.expect("ipdb>")
701
702 # Test wildcard pattern
703 child.sendline("ignore_module testpkg.*")
704 child.expect("ipdb>")
705
706 child.sendline("ignore_module")
707 child.expect_exact("Currently ignored modules: ['level2_module', 'testpkg.*']")
708 child.expect("ipdb>")
709
710 # Test error handling - removing non-existent module
711 child.sendline("unignore_module nonexistent")
712 child.expect_exact("Module nonexistent is not currently ignored")
713 child.expect("ipdb>")
714
715 # Test successful removal
716 child.sendline("unignore_module level2_module")
717 child.expect("ipdb>")
718
719 child.sendline("ignore_module")
720 child.expect_exact("Currently ignored modules: ['testpkg.*']")
721 child.expect("ipdb>")
722
723 # Test removing already removed module
724 child.sendline("unignore_module level2_module")
725 child.expect_exact("Module level2_module is not currently ignored")
726 child.expect("ipdb>")
727
728 # Remove wildcard pattern
729 child.sendline("unignore_module testpkg.*")
730 child.expect("ipdb>")
731

Callers

nothing calls this directly

Calls 3

create_test_modulesFunction · 0.85
copyMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…