diff --git a/CHANGES.rst b/CHANGES.rst index 467d54c..edacea0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,8 @@ For changes before version 3.0, see ``HISTORY.rst``. 7.1 (unreleased) ---------------- +- Respect ``PURE_PYTHON`` environment variable set to ``0`` when running tests. + 7.0 (2024-05-30) ---------------- diff --git a/src/AccessControl/tests/testSecurityManager.py b/src/AccessControl/tests/testSecurityManager.py index 5a86d5d..7087330 100644 --- a/src/AccessControl/tests/testSecurityManager.py +++ b/src/AccessControl/tests/testSecurityManager.py @@ -14,9 +14,10 @@ """Tests for the SecurityManager implementations """ -import os import unittest +from ..Implementation import PURE_PYTHON + _THREAD_ID = 123 @@ -251,7 +252,7 @@ def _getTargetClass(self): return SecurityManager -@unittest.skipIf(os.environ.get('PURE_PYTHON'), reason="Test expects C impl.") +@unittest.skipIf(PURE_PYTHON, reason="Test expects C impl.") class C_SecurityManagerTests(SecurityManagerTestBase, ISecurityManagerConformance, unittest.TestCase): diff --git a/src/AccessControl/tests/testZopeSecurityPolicy.py b/src/AccessControl/tests/testZopeSecurityPolicy.py index 9b12a0f..068c49b 100644 --- a/src/AccessControl/tests/testZopeSecurityPolicy.py +++ b/src/AccessControl/tests/testZopeSecurityPolicy.py @@ -12,7 +12,6 @@ ############################################################################## import _thread as thread -import os import sys import unittest from doctest import DocTestSuite @@ -27,6 +26,8 @@ from AccessControl.SecurityManagement import SecurityContext from AccessControl.userfolder import UserFolder +from ..Implementation import PURE_PYTHON + user_roles = ('RoleOfUser',) eo_roles = ('RoleOfExecutableOwner',) @@ -772,7 +773,7 @@ def test_suite(): unittest.defaultTestLoader.loadTestsFromTestCase(Python_ZSPTests)) suite.addTest( unittest.defaultTestLoader.loadTestsFromTestCase(Python_SMTests)) - if not os.environ.get('PURE_PYTHON'): + if not PURE_PYTHON: suite.addTest( unittest.defaultTestLoader.loadTestsFromTestCase(C_ZSPTests)) suite.addTest(