|
1 | 1 | import os
|
| 2 | +import sys |
2 | 3 | from pathlib import Path
|
| 4 | +from unittest.mock import ANY |
3 | 5 | from unittest.mock import MagicMock
|
4 | 6 | from unittest.mock import Mock
|
5 | 7 | from unittest.mock import call
|
|
8 | 10 | import pytest
|
9 | 11 |
|
10 | 12 | from memray._errors import MemrayCommandError
|
| 13 | +from memray._memray import FileFormat |
11 | 14 | from memray.commands.common import HighWatermarkCommand
|
12 | 15 |
|
13 | 16 |
|
@@ -165,6 +168,9 @@ def test_tracker_and_reporter_interactions_for_peak(self, tmp_path, merge_thread
|
165 | 168 | calls = [
|
166 | 169 | call(os.fspath(result_path), report_progress=True),
|
167 | 170 | call().metadata.has_native_traces.__bool__(),
|
| 171 | + call().metadata.file_format.__eq__(FileFormat.ALL_ALLOCATIONS) |
| 172 | + if sys.version_info > (3, 7, 0) |
| 173 | + else ANY, |
168 | 174 | call().get_high_watermark_allocation_records(merge_threads=merge_threads),
|
169 | 175 | call().get_memory_snapshots(),
|
170 | 176 | ]
|
@@ -195,6 +201,9 @@ def test_tracker_and_reporter_interactions_for_leak(self, tmp_path, merge_thread
|
195 | 201 | calls = [
|
196 | 202 | call(os.fspath(result_path), report_progress=True),
|
197 | 203 | call().metadata.has_native_traces.__bool__(),
|
| 204 | + call().metadata.file_format.__eq__(FileFormat.ALL_ALLOCATIONS) |
| 205 | + if sys.version_info > (3, 7, 0) |
| 206 | + else ANY, |
198 | 207 | call().get_leaked_allocation_records(merge_threads=merge_threads),
|
199 | 208 | call().get_memory_snapshots(),
|
200 | 209 | ]
|
@@ -227,6 +236,9 @@ def test_tracker_and_reporter_interactions_for_temporary_allocations(
|
227 | 236 | calls = [
|
228 | 237 | call(os.fspath(result_path), report_progress=True),
|
229 | 238 | call().metadata.has_native_traces.__bool__(),
|
| 239 | + call().metadata.file_format.__eq__(FileFormat.ALL_ALLOCATIONS) |
| 240 | + if sys.version_info > (3, 7, 0) |
| 241 | + else ANY, |
230 | 242 | call().get_temporary_allocation_records(
|
231 | 243 | threshold=3, merge_threads=merge_threads
|
232 | 244 | ),
|
|
0 commit comments