Skip to content

Commit 94282bd

Browse files
authored
Respect PURE_PYTHON environment variable set to 0 (#158)
Setting to 0 should be equivalent to not setting the variable. Refs zopefoundation/meta#283
1 parent 4779653 commit 94282bd

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ For changes before version 3.0, see ``HISTORY.rst``.
66
7.1 (unreleased)
77
----------------
88

9+
- Respect ``PURE_PYTHON`` environment variable set to ``0`` when running tests.
10+
911

1012
7.0 (2024-05-30)
1113
----------------

src/AccessControl/tests/testSecurityManager.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
"""Tests for the SecurityManager implementations
1515
"""
1616

17-
import os
1817
import unittest
1918

19+
from ..Implementation import PURE_PYTHON
20+
2021

2122
_THREAD_ID = 123
2223

@@ -251,7 +252,7 @@ def _getTargetClass(self):
251252
return SecurityManager
252253

253254

254-
@unittest.skipIf(os.environ.get('PURE_PYTHON'), reason="Test expects C impl.")
255+
@unittest.skipIf(PURE_PYTHON, reason="Test expects C impl.")
255256
class C_SecurityManagerTests(SecurityManagerTestBase,
256257
ISecurityManagerConformance,
257258
unittest.TestCase):

src/AccessControl/tests/testZopeSecurityPolicy.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
##############################################################################
1313

1414
import _thread as thread
15-
import os
1615
import sys
1716
import unittest
1817
from doctest import DocTestSuite
@@ -27,6 +26,8 @@
2726
from AccessControl.SecurityManagement import SecurityContext
2827
from AccessControl.userfolder import UserFolder
2928

29+
from ..Implementation import PURE_PYTHON
30+
3031

3132
user_roles = ('RoleOfUser',)
3233
eo_roles = ('RoleOfExecutableOwner',)
@@ -772,7 +773,7 @@ def test_suite():
772773
unittest.defaultTestLoader.loadTestsFromTestCase(Python_ZSPTests))
773774
suite.addTest(
774775
unittest.defaultTestLoader.loadTestsFromTestCase(Python_SMTests))
775-
if not os.environ.get('PURE_PYTHON'):
776+
if not PURE_PYTHON:
776777
suite.addTest(
777778
unittest.defaultTestLoader.loadTestsFromTestCase(C_ZSPTests))
778779
suite.addTest(

0 commit comments

Comments
 (0)