File: test_exception.py

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

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

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

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