File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 19
19
20
20
from test .support .os_helper import unlink
21
21
22
+ PROCESS_VM_READV_SUPPORTED = False
23
+
24
+ try :
25
+ from _remote_debugging import PROCESS_VM_READV_SUPPORTED
26
+ except ImportError :
27
+ raise unittest .SkipTest (
28
+ "Test only runs when _remote_debugging is available"
29
+ )
30
+
22
31
23
32
class MockFrameInfo :
24
33
"""Mock FrameInfo for testing since the real one isn't accessible."""
@@ -256,11 +265,13 @@ def test_pstats_collector_export(self):
256
265
self .assertEqual (func1_stats [3 ], 2.0 ) # ct (cumulative time)
257
266
258
267
268
+ @unittest .skipIf (
269
+ sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
270
+ "Test only runs on Linux with process_vm_readv support" ,
271
+ )
259
272
class TestSampleProfilerIntegration (unittest .TestCase ):
260
273
@classmethod
261
274
def setUpClass (cls ):
262
- cls .python_exe = sys .executable
263
-
264
275
cls .test_script = '''
265
276
import time
266
277
import os
@@ -472,6 +483,10 @@ def test_sampling_all_threads(self):
472
483
# We're not testing output format here
473
484
474
485
486
+ @unittest .skipIf (
487
+ sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
488
+ "Test only runs on Linux with process_vm_readv support" ,
489
+ )
475
490
class TestSampleProfilerErrorHandling (unittest .TestCase ):
476
491
def test_invalid_pid (self ):
477
492
with self .assertRaises ((OSError , RuntimeError )):
You can’t perform that action at this time.
0 commit comments