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

Function test_ignore_module_all_commands

tests/test_debugger.py:854–981  ·  view source on GitHub ↗

Comprehensive test for all debugger commands (up/down/step/next) with ignore functionality.

()

Source from the content-addressed store, hash-verified

852
853@skip_win32
854def test_ignore_module_all_commands():
855 """Comprehensive test for all debugger commands (up/down/step/next) with ignore functionality."""
856 import pexpect
857
858 env = os.environ.copy()
859 env["IPY_TEST_SIMPLE_PROMPT"] = "1"
860
861 with TemporaryDirectory() as temp_dir:
862 main_path = create_test_modules(temp_dir)
863
864 # Test UP and DOWN commands
865 child = pexpect.spawn(sys.executable, [main_path], env=env, cwd=temp_dir)
866 child.timeout = 15 * IPYTHON_TESTING_TIMEOUT_SCALE
867 child.expect("ipdb>")
868
869 # Test up without ignores (baseline)
870 child.sendline("up")
871 child.expect("ipdb>")
872 child.sendline("__name__")
873 child.expect_exact("level2_module")
874 child.expect("ipdb>")
875
876 # Reset position
877 child.sendline("down")
878 child.expect("ipdb>")
879
880 # Test up with single module ignore
881 child.sendline("ignore_module level2_module")
882 child.expect("ipdb>")
883 child.sendline("up")
884 child.expect_exact(
885 "[... skipped 1 frame(s): 0 hidden frames + 1 ignored modules]"
886 )
887 child.expect("ipdb>")
888 child.sendline("__name__")
889 child.expect_exact("level1_module")
890 child.expect("ipdb>")
891
892 # Test up with wildcard ignore
893 child.sendline("down")
894 child.expect_exact(
895 "[... skipped 1 frame(s): 0 hidden frames + 1 ignored modules]"
896 )
897 child.expect("ipdb>")
898 child.sendline("unignore_module level2_module")
899 child.expect("ipdb>")
900 child.sendline("ignore_module level*")
901 child.expect("ipdb>")
902 child.sendline("up")
903 child.expect_exact(
904 "[... skipped 2 frame(s): 0 hidden frames + 2 ignored modules]"
905 )
906 child.expect("ipdb>")
907 child.sendline("__name__")
908 child.expect_exact("__main__")
909 child.expect("ipdb>")
910
911 child.sendline("continue")

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…