summaryrefslogtreecommitdiff
path: root/Cython/Compiler/Tests
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2022-07-20 18:19:44 +0200
committerStefan Behnel <stefan_ml@behnel.de>2022-07-20 18:19:44 +0200
commit3a373e2ccdddc79202d9ed13edc85d4b95616b26 (patch)
treea3bed9f6045df649692287cb640d5ce5ca04b459 /Cython/Compiler/Tests
parent4d626caa314c8d6de741185e3ec11199effb8f22 (diff)
downloadcython-3a373e2ccdddc79202d9ed13edc85d4b95616b26.tar.gz
Make pickle checksum calculation succeed even if one of the hash algorithms is blocked at runtime.
Also, pass "usedforsecurity=False" in Py3.9+ to unblock MD5 also on some security constrained systems (FIPS). Closes https://github.com/cython/cython/issues/4909
Diffstat (limited to 'Cython/Compiler/Tests')
-rw-r--r--Cython/Compiler/Tests/TestParseTreeTransforms.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Cython/Compiler/Tests/TestParseTreeTransforms.py b/Cython/Compiler/Tests/TestParseTreeTransforms.py
index 234b45db5..8a16f98cc 100644
--- a/Cython/Compiler/Tests/TestParseTreeTransforms.py
+++ b/Cython/Compiler/Tests/TestParseTreeTransforms.py
@@ -1,7 +1,9 @@
-import os
+import os.path
+import unittest
from Cython.TestUtils import TransformTest
from Cython.Compiler.ParseTreeTransforms import *
+from Cython.Compiler.ParseTreeTransforms import _calculate_pickle_checksums
from Cython.Compiler.Nodes import *
from Cython.Compiler import Main, Symtab
@@ -276,6 +278,11 @@ class TestDebugTransform(DebuggerTestCase):
raise
+class TestAnalyseDeclarationsTransform(unittest.TestCase):
+ def test_calculate_pickle_checksums(self):
+ checksums = _calculate_pickle_checksums(['member1', 'member2', 'member3'])
+ assert 2 <= len(checksums) <= 3, checksums # expecting ['0xc0af380' (MD5), '0x0c75bd4', '0xa7a7b94']
+
if __name__ == "__main__":
import unittest