(generate_threads, python, tmpdir)
| 347 | @ALL_PYTHONS |
| 348 | @ALL_SOURCES |
| 349 | def test_gigantic_integer(generate_threads, python, tmpdir): |
| 350 | # GIVEN |
| 351 | _, python_executable = python |
| 352 | |
| 353 | program_template = """ |
| 354 | import sys |
| 355 | import time |
| 356 | |
| 357 | def first_func(): |
| 358 | the_local = 999999999999999999999999 |
| 359 | second_func(the_local) |
| 360 | |
| 361 | def 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 | |
| 367 | first_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 |
nothing calls this directly
no test coverage detected