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

Function test_xmode_skip

IPython/core/tests/test_debugger.py:263–326  ·  view source on GitHub ↗

that xmode skip frames Not as a doctest as pytest does not run doctests.

()

Source from the content-addressed store, hash-verified

261
262@skip_win32
263def test_xmode_skip():
264 """that xmode skip frames
265
266 Not as a doctest as pytest does not run doctests.
267 """
268 import pexpect
269 env = os.environ.copy()
270 env["IPY_TEST_SIMPLE_PROMPT"] = "1"
271
272 child = pexpect.spawn(
273 sys.executable, ["-m", "IPython", "--colors=nocolor"], env=env
274 )
275 child.timeout = 15 * IPYTHON_TESTING_TIMEOUT_SCALE
276
277 child.expect("IPython")
278 child.expect("\n")
279 child.expect_exact("In [1]")
280
281 block = dedent(
282 """
283def f():
284 __tracebackhide__ = True
285 g()
286
287def g():
288 raise ValueError
289
290f()
291 """
292 )
293
294 for line in block.splitlines():
295 child.sendline(line)
296 child.expect_exact(line)
297 child.expect_exact("skipping")
298
299 block = dedent(
300 """
301def f():
302 __tracebackhide__ = True
303 g()
304
305def g():
306 from IPython.core.debugger import set_trace
307 set_trace()
308
309f()
310 """
311 )
312
313 for line in block.splitlines():
314 child.sendline(line)
315 child.expect_exact(line)
316
317 child.expect("ipdb>")
318 child.sendline("w")
319 child.expect("hidden")
320 child.expect("ipdb>")

Callers

nothing calls this directly

Calls 3

dedentFunction · 0.85
copyMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected