Skip to content

Commit 7a03947

Browse files
committed
Skip the test without multiprocessing
1 parent c8a850e commit 7a03947

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Lib/test/test_re.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
cpython_only, captured_stdout,
33
check_disallow_instantiation, is_emscripten, is_wasi,
44
SHORT_TIMEOUT)
5-
import multiprocessing
65
import locale
76
import re
87
import string
@@ -13,6 +12,14 @@
1312
from re import Scanner
1413
from weakref import proxy
1514

15+
# some platforms lack working multiprocessing
16+
try:
17+
import _multiprocessing
18+
except ImportError:
19+
multiprocessing = None
20+
else:
21+
import multiprocessing
22+
1623
# Misc tests from Tim Peters' re.doc
1724

1825
# WARNING: Don't change details in these tests if you don't know
@@ -2409,6 +2416,7 @@ def test_template_function_and_flag_is_deprecated(self):
24092416
self.assertTrue(template_re1.match('ahoy'))
24102417
self.assertFalse(template_re1.match('nope'))
24112418

2419+
@unittest.skipIf(multiprocessing is None, 'test requires multiprocessing')
24122420
def test_regression_gh94675(self):
24132421
pattern = re.compile(r'(?<=[({}])(((//[^\n]*)?[\n])([\000-\040])*)*'
24142422
r'((/[^/\[\n]*(([^\n]|(\[\n]*(]*)*\]))'

0 commit comments

Comments
 (0)