MCPcopy Create free account
hub / github.com/bloomberg/pystack / test_gigantic_integer

Function test_gigantic_integer

tests/integration/test_local_variables.py:349–391  ·  view source on GitHub ↗
(generate_threads, python, tmpdir)

Source from the content-addressed store, hash-verified

347@ALL_PYTHONS
348@ALL_SOURCES
349def test_gigantic_integer(generate_threads, python, tmpdir):
350 # GIVEN
351 _, python_executable = python
352
353 program_template = """
354import sys
355import time
356
357def first_func():
358 the_local = 999999999999999999999999
359 second_func(the_local)
360
361def second_func(the_argument):
362 fifo = sys.argv[1]
363 with open(sys.argv[1], "w") as fifo:
364 fifo.write("ready")
365 time.sleep(1000)
366
367first_func()
368 """
369
370 script = tmpdir / "the_script.py"
371 script.write_text(program_template, encoding="utf-8")
372
373 # WHEN
374
375 threads = generate_threads(python_executable, script, tmpdir)
376
377 # THEN
378
379 assert len(threads) == 1
380 (thread,) = threads
381
382 frames = list(thread.frames)
383 assert (len(frames)) == 3
384
385 first_func_frame = find_frame(frames, "first_func")
386 assert "the_local" in first_func_frame.locals
387 assert first_func_frame.locals["the_local"] == "<UNRESOLVED BIG INT>"
388
389 second_func_frame = find_frame(frames, "second_func")
390 assert "the_argument" in second_func_frame.arguments
391 assert second_func_frame.arguments["the_argument"] == "<UNRESOLVED BIG INT>"
392
393
394@ALL_PYTHONS

Callers

nothing calls this directly

Calls 1

find_frameFunction · 0.85

Tested by

no test coverage detected