()
| 18 | the_file.write('Testing\n') |
| 19 | |
| 20 | def 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 | |
| 30 | def test_return_value_consistency(): |
no test coverage detected