File: test_memory_usage.py

package info (click to toggle)
python-memory-profiler 0.41%2Bgit20161018-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 280 kB
  • ctags: 163
  • sloc: python: 1,469; makefile: 24
file content (15 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from memory_profiler import memory_usage


def some_func(*args, **kwargs):
    return args, kwargs


def test_memory_usage():
    # Check that memory_usage works with functions with star args.
    mem, ret = memory_usage((some_func, (1, 2), dict(a=1)), retval=True)
    assert ret[0] == (1, 2)
    assert ret[1] == dict(a=1)

if __name__ == "__main__":
    test_memory_usage()