From 1967ab7e8a6f4e4894ef9a4333a69f64fa47b19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= Date: Mon, 30 Sep 2024 07:12:11 +0000 Subject: [PATCH] fixup! Respect `PURE_PYTHON=0` environment variable --- src/AccessControl/tests/testSecurityManager.py | 5 +++-- src/AccessControl/tests/testZopeSecurityPolicy.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/AccessControl/tests/testSecurityManager.py b/src/AccessControl/tests/testSecurityManager.py index 0181afa..bdd9bca 100644 --- a/src/AccessControl/tests/testSecurityManager.py +++ b/src/AccessControl/tests/testSecurityManager.py @@ -17,6 +17,8 @@ import os import unittest +from ..Implementation import PURE_PYTHON + _THREAD_ID = 123 @@ -251,8 +253,7 @@ def _getTargetClass(self): return SecurityManager -@unittest.skipIf(int(os.environ.get('PURE_PYTHON', '0')), - 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 103f948..86293cb 100644 --- a/src/AccessControl/tests/testZopeSecurityPolicy.py +++ b/src/AccessControl/tests/testZopeSecurityPolicy.py @@ -27,6 +27,8 @@ from AccessControl.SecurityManagement import SecurityContext from AccessControl.userfolder import UserFolder +from ..Implementation import PURE_PYTHON + user_roles = ('RoleOfUser',) eo_roles = ('RoleOfExecutableOwner',) @@ -772,7 +774,7 @@ def test_suite(): unittest.defaultTestLoader.loadTestsFromTestCase(Python_ZSPTests)) suite.addTest( unittest.defaultTestLoader.loadTestsFromTestCase(Python_SMTests)) - if not int(os.environ.get('PURE_PYTHON', '0')): + if not PURE_PYTHON: suite.addTest( unittest.defaultTestLoader.loadTestsFromTestCase(C_ZSPTests)) suite.addTest(