Skip to content

Commit

Permalink
debug failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Sep 15, 2024
1 parent 4a1b060 commit 488097d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_autoprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,20 @@ def test_autoprofile_script_with_prof_imports():
# pytest.skip('Failing due to the noop bug')

args = [sys.executable, '-m', 'kernprof', '--prof-imports', '-p', 'script.py', '-l', os.fspath(script_fpath)]
proc = ub.cmd(args, cwd=temp_dpath, verbose=2)
proc = ub.cmd(args, cwd=temp_dpath, verbose=3)
print('Kernprof Stdout:')
print(proc.stdout)
print('Kernprof Stderr:')
print(proc.stderr)
print('About to check kernprof return code')
proc.check_returncode()

args = [sys.executable, '-m', 'line_profiler', os.fspath(script_fpath) + '.lprof']
proc = ub.cmd(args, cwd=temp_dpath)
proc = ub.cmd(args, cwd=temp_dpath, verbose=3)
raw_output = proc.stdout
print('Line_profile Stdout:')
print(raw_output)
print('About to check line_profiler return code')
proc.check_returncode()

assert 'Function: add_one' in raw_output
Expand Down

0 comments on commit 488097d

Please sign in to comment.