@@ -24,10 +24,13 @@ def _make_test_script(script_dir, script_basename, source):
2424importlib .invalidate_caches ()
2525return to_return
2626
27+ skip_if_not_supported = unittest .skipIf ((sys .platform != "darwin"
28+ and sys .platform != "linux"
29+ and sys .platform != "win32" ),
30+ "Test only runs on Linux, Windows and MacOS" )
2731class TestGetStackTrace (unittest .TestCase ):
2832
29- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
30- "Test only runs on Linux and MacOS" )
33+ @skip_if_not_supported
3134@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
3235"Test only runs on Linux with process_vm_readv support" )
3336def test_remote_stack_trace (self ):
@@ -79,8 +82,7 @@ def foo():
7982 ]
8083self .assertEqual (stack_trace ,expected_stack_trace )
8184
82- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
83- "Test only runs on Linux and MacOS" )
85+ @skip_if_not_supported
8486@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
8587"Test only runs on Linux with process_vm_readv support" )
8688def test_async_remote_stack_trace (self ):
@@ -169,8 +171,7 @@ def new_eager_loop():
169171 ]
170172self .assertEqual (stack_trace ,expected_stack_trace )
171173
172- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
173- "Test only runs on Linux and MacOS" )
174+ @skip_if_not_supported
174175@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
175176"Test only runs on Linux with process_vm_readv support" )
176177def test_asyncgen_remote_stack_trace (self ):
@@ -227,8 +228,7 @@ async def main():
227228 ]
228229self .assertEqual (stack_trace ,expected_stack_trace )
229230
230- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
231- "Test only runs on Linux and MacOS" )
231+ @skip_if_not_supported
232232@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
233233"Test only runs on Linux with process_vm_readv support" )
234234def test_async_gather_remote_stack_trace (self ):
@@ -287,8 +287,7 @@ async def main():
287287 ]
288288self .assertEqual (stack_trace ,expected_stack_trace )
289289
290- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
291- "Test only runs on Linux and MacOS" )
290+ @skip_if_not_supported
292291@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
293292"Test only runs on Linux with process_vm_readv support" )
294293def test_async_staggered_race_remote_stack_trace (self ):
@@ -350,8 +349,7 @@ async def main():
350349 ]
351350self .assertEqual (stack_trace ,expected_stack_trace )
352351
353- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
354- "Test only runs on Linux and MacOS" )
352+ @skip_if_not_supported
355353@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
356354"Test only runs on Linux with process_vm_readv support" )
357355def test_async_global_awaited_by (self ):
@@ -470,8 +468,7 @@ async def main():
470468p .terminate ()
471469p .wait (timeout = SHORT_TIMEOUT )
472470
473- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
474- "Test only runs on Linux and MacOS" )
471+ @skip_if_not_supported
475472@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
476473"Test only runs on Linux with process_vm_readv support" )
477474def test_self_trace (self ):