# HG changeset patch # User schlamar # Date 1395052147 -3600 # Mon Mar 17 11:29:07 2014 +0100 # Branch 2.7 # Node ID 8a566b29b73b1d5217ff4cbdfc16e89db38ab7d3 # Parent e1c35f4bf597da1b3178c70b692b40d97f5af959 Issue20954: added TestCase. diff -r e1c35f4bf597 -r 8a566b29b73b Lib/test/test_multiprocessing.py --- a/Lib/test/test_multiprocessing.py Mon Mar 17 10:39:49 2014 +0100 +++ b/Lib/test/test_multiprocessing.py Mon Mar 17 11:29:07 2014 +0100 @@ -2431,6 +2431,24 @@ child_flags, grandchild_flags = json.loads(data.decode('ascii')) self.assertEqual(child_flags, grandchild_flags) + @classmethod + def grandchild_hash_seed(cls): + pass + + @classmethod + def child_hash_seed(cls): + p = multiprocessing.Process(target=cls.grandchild_hash_seed) + p.start() + p.join() + + def test_hash_seed(self): # Issue20954 + import subprocess + prog = ('from test.test_multiprocessing import TestFlags; ' + + 'TestFlags.child_hash_seed()') + env = os.environ.copy() + env['PYTHONHASHSEED'] = '2147483647' + subprocess.check_call([sys.executable, '-c', prog], env=env) + # # Issue #17555: ForkAwareThreadLock #