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 1919
2020from test .support .os_helper import unlink
2121
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+
2231
2332class MockFrameInfo :
2433 """Mock FrameInfo for testing since the real one isn't accessible."""
@@ -256,11 +265,13 @@ def test_pstats_collector_export(self):
256265 self .assertEqual (func1_stats [3 ], 2.0 ) # ct (cumulative time)
257266
258267
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+ )
259272class TestSampleProfilerIntegration (unittest .TestCase ):
260273 @classmethod
261274 def setUpClass (cls ):
262- cls .python_exe = sys .executable
263-
264275 cls .test_script = '''
265276import time
266277import os
@@ -472,6 +483,10 @@ def test_sampling_all_threads(self):
472483 # We're not testing output format here
473484
474485
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+ )
475490class TestSampleProfilerErrorHandling (unittest .TestCase ):
476491 def test_invalid_pid (self ):
477492 with self .assertRaises ((OSError , RuntimeError )):
You can’t perform that action at this time.
0 commit comments