Skip to content

Commit 3615b3f

Browse files
committed
Integrated the custom RustPython function into test_multiprocessing + added handling for regrtest windows failure
1 parent 45212bd commit 3615b3f

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6717,18 +6717,18 @@ class ThreadsMixin(BaseMixin):
67176717
#
67186718

67196719

6720-
def get_temp_class(test_name, module, base, Mixin, type_):
6720+
def get_temp_class(newname, __module__, base, Mixin, type_):
67216721
# RUSTPYTHON specific function to define the Temp class
67226722

67236723
# test_rapid_restart fails on:
67246724
# - 'test_multiprocessing_fork' in 'WithManagerTestManagerRestart' test, on windows and mac
67256725
# - 'test_multiprocessing_forkserver' in 'WithManagerTestManagerRestart' test on windows
67266726
# - `test_multiprocessing_spawn` in 'WithManagerTestManagerRestart' test on windows
67276727
if (
6728-
test_name == 'WithManagerTestManagerRestart' and
6728+
newname == 'WithManagerTestManagerRestart' and
67296729
(
67306730
sys.platform == "win32" or
6731-
(sys.platform == "darwin" and 'test_multiprocessing_fork' in module)
6731+
(sys.platform == "darwin" and 'test_multiprocessing_fork' in __module__)
67326732
)
67336733
):
67346734
class Temp(base, Mixin, unittest.TestCase):
@@ -6765,21 +6765,7 @@ def install_tests_in_module_dict(remote_globs, start_method,
67656765
continue
67666766
newname = 'With' + type_.capitalize() + name[1:]
67676767
Mixin = local_globs[type_.capitalize() + 'Mixin']
6768-
if (newname == 'WithManagerTestManagerRestart' and
6769-
(
6770-
sys.platform == "win32" or
6771-
(sys.platform == "darwin" and '.test_multiprocessing_fork.' in __module__)
6772-
)):
6773-
class Temp(base, Mixin, unittest.TestCase):
6774-
@unittest.expectedFailure #TODO: RUSTPYTHON
6775-
def test_rapid_restart(self):
6776-
super().test_rapid_restart()
6777-
6778-
else:
6779-
class Temp(base, Mixin, unittest.TestCase):
6780-
pass
6781-
if type_ == 'manager':
6782-
Temp = hashlib_helper.requires_hashdigest('sha256')(Temp)
6768+
Temp = get_temp_class(newname, __module__, base, Mixin, type_)
67836769
Temp.__name__ = Temp.__qualname__ = newname
67846770
Temp.__module__ = __module__
67856771
Temp.start_method = start_method

Lib/test/test_regrtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ def test_module_test(self):
890890
*self.regrtest_args, *self.tests]
891891
self.run_tests(args)
892892

893-
@unittest.expectedFailure # TODO: RUSTPYTHON
893+
@unittest.expectedFailureIfWindows('TODO: RUSTPYTHON')
894894
def test_module_regrtest(self):
895895
# -m test.regrtest
896896
args = [*self.python_args, '-m', 'test.regrtest',

0 commit comments

Comments
 (0)