@@ -24,10 +24,13 @@ def _make_test_script(script_dir, script_basename, source):
24
24
importlib .invalidate_caches ()
25
25
return to_return
26
26
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" )
27
31
class TestGetStackTrace (unittest .TestCase ):
28
32
29
- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
30
- "Test only runs on Linux and MacOS" )
33
+ @skip_if_not_supported
31
34
@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
32
35
"Test only runs on Linux with process_vm_readv support" )
33
36
def test_remote_stack_trace (self ):
@@ -79,8 +82,7 @@ def foo():
79
82
]
80
83
self .assertEqual (stack_trace , expected_stack_trace )
81
84
82
- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
83
- "Test only runs on Linux and MacOS" )
85
+ @skip_if_not_supported
84
86
@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
85
87
"Test only runs on Linux with process_vm_readv support" )
86
88
def test_async_remote_stack_trace (self ):
@@ -169,8 +171,7 @@ def new_eager_loop():
169
171
]
170
172
self .assertEqual (stack_trace , expected_stack_trace )
171
173
172
- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
173
- "Test only runs on Linux and MacOS" )
174
+ @skip_if_not_supported
174
175
@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
175
176
"Test only runs on Linux with process_vm_readv support" )
176
177
def test_asyncgen_remote_stack_trace (self ):
@@ -227,8 +228,7 @@ async def main():
227
228
]
228
229
self .assertEqual (stack_trace , expected_stack_trace )
229
230
230
- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
231
- "Test only runs on Linux and MacOS" )
231
+ @skip_if_not_supported
232
232
@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
233
233
"Test only runs on Linux with process_vm_readv support" )
234
234
def test_async_gather_remote_stack_trace (self ):
@@ -287,8 +287,7 @@ async def main():
287
287
]
288
288
self .assertEqual (stack_trace , expected_stack_trace )
289
289
290
- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
291
- "Test only runs on Linux and MacOS" )
290
+ @skip_if_not_supported
292
291
@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
293
292
"Test only runs on Linux with process_vm_readv support" )
294
293
def test_async_staggered_race_remote_stack_trace (self ):
@@ -350,8 +349,7 @@ async def main():
350
349
]
351
350
self .assertEqual (stack_trace , expected_stack_trace )
352
351
353
- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
354
- "Test only runs on Linux and MacOS" )
352
+ @skip_if_not_supported
355
353
@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
356
354
"Test only runs on Linux with process_vm_readv support" )
357
355
def test_async_global_awaited_by (self ):
@@ -470,8 +468,7 @@ async def main():
470
468
p .terminate ()
471
469
p .wait (timeout = SHORT_TIMEOUT )
472
470
473
- @unittest .skipIf (sys .platform != "darwin" and sys .platform != "linux" ,
474
- "Test only runs on Linux and MacOS" )
471
+ @skip_if_not_supported
475
472
@unittest .skipIf (sys .platform == "linux" and not PROCESS_VM_READV_SUPPORTED ,
476
473
"Test only runs on Linux with process_vm_readv support" )
477
474
def test_self_trace (self ):
0 commit comments