File: test_exception.py

package info (click to toggle)
python-memory-profiler 0.52-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 296 kB
  • sloc: python: 1,628; makefile: 30
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')