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..0181afa 100644 --- a/src/AccessControl/tests/testSecurityManager.py +++ b/src/AccessControl/tests/testSecurityManager.py @@ -251,7 +251,8 @@ def _getTargetClass(self): return SecurityManager -@unittest.skipIf(os.environ.get('PURE_PYTHON'), reason="Test expects C impl.") +@unittest.skipIf(int(os.environ.get('PURE_PYTHON', '0')), + 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..103f948 100644 --- a/src/AccessControl/tests/testZopeSecurityPolicy.py +++ b/src/AccessControl/tests/testZopeSecurityPolicy.py @@ -772,7 +772,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 int(os.environ.get('PURE_PYTHON', '0')): suite.addTest( unittest.defaultTestLoader.loadTestsFromTestCase(C_ZSPTests)) suite.addTest(