File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed
Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change 1+ import inspect
2+ import multiprocessing
13import unittest
2- import test . _test_multiprocessing
4+ from multiprocessing import dummy
35
4- from test import support
56
6- if support .PGO :
7- raise unittest .SkipTest ("test is not helpful for PGO" )
7+ class TestMultiprocessingDummy (unittest .TestCase ):
8+ def test_signatures (self ):
9+ """Check that the signatures in multiprocessing.dummy match these of multiprocessing."""
810
9- test ._test_multiprocessing .install_tests_in_module_dict (globals (), 'dummy' )
11+ common = set (dummy .__all__ ) & set (multiprocessing .__all__ )
12+
13+ # Skip Locks (these have no parameters anyway)
14+ common .remove ("Lock" )
15+ common .remove ("RLock" )
16+
17+ for name in common :
18+ print (name )
19+
20+ dummy_obj = getattr (dummy , name )
21+ multiprocessing_obj = getattr (multiprocessing , name )
22+
23+ dummy_sig = inspect .signature (dummy_obj )
24+ multiprocessing_sig = inspect .signature (multiprocessing_obj )
25+
26+ assert dummy_sig == multiprocessing_sig , f"{ name } : { dummy_sig } != { multiprocessing_sig } "
1027
1128if __name__ == '__main__' :
1229 unittest .main ()
You can’t perform that action at this time.
0 commit comments