File: test_exception.py

package info (click to toggle)
python-memory-profiler 0.61-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 540 kB
  • sloc: python: 2,220; makefile: 33
file content (12 lines) | stat: -rw-r--r-- 267 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12

# make sure that memory profiler does not hang on exception
from memory_profiler import memory_usage

def foo():
    raise NotImplementedError('Error')

try:
    out = memory_usage((foo, tuple(), {}), timeout=1)
except NotImplementedError:
    pass
print('Success')