@@ -6715,6 +6715,33 @@ class ThreadsMixin(BaseMixin):
67156715# Functions used to create test cases from the base ones in this module
67166716#
67176717
6718+
6719+ def get_temp_class (test_name , module , base , Mixin , type_ ):
6720+ # RUSTPYTHON specific function to define the Temp class
6721+
6722+ # test_rapid_restart fails on:
6723+ # - 'test_multiprocessing_fork' in 'WithManagerTestManagerRestart' test, on windows and mac
6724+ # - 'test_multiprocessing_forkserver' in 'WithManagerTestManagerRestart' test on windows
6725+ # - `test_multiprocessing_spawn` in 'WithManagerTestManagerRestart' test on windows
6726+ if (
6727+ test_name == 'WithManagerTestManagerRestart' and
6728+ (
6729+ sys .platform == "win32" or
6730+ (sys .platform == "darwin" and 'test_multiprocessing_fork' in module )
6731+ )
6732+ ):
6733+ class Temp (base , Mixin , unittest .TestCase ):
6734+ @unittest .expectedFailure #TODO: RUSTPYTHON
6735+ def test_rapid_restart (self ):
6736+ super ().test_rapid_restart ()
6737+
6738+ else :
6739+ class Temp (base , Mixin , unittest .TestCase ):
6740+ pass
6741+ if type_ == 'manager' :
6742+ Temp = hashlib_helper .requires_hashdigest ('sha256' )(Temp )
6743+ return Temp
6744+
67186745def install_tests_in_module_dict (remote_globs , start_method ,
67196746 only_type = None , exclude_types = False ):
67206747 __module__ = remote_globs ['__name__' ]
@@ -6737,7 +6764,13 @@ def install_tests_in_module_dict(remote_globs, start_method,
67376764 continue
67386765 newname = 'With' + type_ .capitalize () + name [1 :]
67396766 Mixin = local_globs [type_ .capitalize () + 'Mixin' ]
6740- if newname == "WithManagerTestManagerRestart" :
6767+ # Temp = get_temp_class(newname, __module__, base, Mixin, type_)
6768+ # print(f"Temp is {Temp}")
6769+ if (newname == 'WithManagerTestManagerRestart' and
6770+ (
6771+ sys .platform == "win32" or
6772+ (sys .platform == "darwin" and '.test_multiprocessing_fork.' in module )
6773+ )):
67416774 class Temp (base , Mixin , unittest .TestCase ):
67426775 @unittest .expectedFailure #TODO: RUSTPYTHON
67436776 def test_rapid_restart (self ):
0 commit comments