diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-02-21 21:08:05 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-02-21 21:08:05 (GMT) |
commit | c9f54cf512996790266c17f81584c9725ee99d47 (patch) | |
tree | f1208c4e6d7a2f2065a9ebcac6d602eedf8aae66 /Lib | |
parent | 6ca5a4d49fdc55c2555a9692097e9966fd8b804f (diff) | |
download | cpython-c9f54cf512996790266c17f81584c9725ee99d47.zip cpython-c9f54cf512996790266c17f81584c9725ee99d47.tar.gz cpython-c9f54cf512996790266c17f81584c9725ee99d47.tar.bz2 |
enable hash randomization by default
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_cmd_line.py | 4 | ||||
-rw-r--r-- | Lib/test/test_hash.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 01af9b9..8c960b1 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -330,14 +330,14 @@ class CmdLineTest(unittest.TestCase): hashes = [] for i in range(2): code = 'print(hash("spam"))' - rc, out, err = assert_python_ok('-R', '-c', code) + rc, out, err = assert_python_ok('-c', code) self.assertEqual(rc, 0) hashes.append(out) self.assertNotEqual(hashes[0], hashes[1]) # Verify that sys.flags contains hash_randomization code = 'import sys; print("random is", sys.flags.hash_randomization)' - rc, out, err = assert_python_ok('-R', '-c', code) + rc, out, err = assert_python_ok('-c', code) self.assertEqual(rc, 0) self.assertIn(b'random is 1', out) diff --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py index a104548..137165f 100644 --- a/Lib/test/test_hash.py +++ b/Lib/test/test_hash.py @@ -159,8 +159,8 @@ class StringlikeHashRandomizationTests(HashRandomizationTests): else: known_hash_of_obj = -1600925533 - # Randomization is disabled by default: - self.assertEqual(self.get_hash(self.repr_), known_hash_of_obj) + # Randomization is enabled by default: + self.assertNotEqual(self.get_hash(self.repr_), known_hash_of_obj) # It can also be disabled by setting the seed to 0: self.assertEqual(self.get_hash(self.repr_, seed=0), known_hash_of_obj) |