MCPcopy Index your code
hub / github.com/pythonprofilers/memory_profiler / test_max_iterations

Function test_max_iterations

test/test_memory_usage.py:20–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 the_file.write('Testing\n')
19
20def test_max_iterations():
21 # Check that memory_usage works with max_iterations set (for python functions).
22 this_dir = os.path.dirname(os.path.realpath(__file__))
23 file = os.path.join(this_dir, 'temp_test_max_iterations_file.txt')
24 mem = memory_usage((write_line, (file, ), dict()), max_usage=True, max_iterations=1)
25 n_lines = sum(1 for line in open(file))
26 os.remove(file)
27 assert n_lines == 1
28
29
30def test_return_value_consistency():

Callers 1

Calls 1

memory_usageFunction · 0.90

Tested by

no test coverage detected