Skip to content

Commit

Permalink
Respect PURE_PYTHON environment variable set to 0 (#158)
Browse files Browse the repository at this point in the history
Setting to 0 should be equivalent to not setting the variable.

Refs zopefoundation/meta#283
  • Loading branch information
perrinjerome authored Sep 30, 2024
1 parent 4779653 commit 94282bd
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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)
----------------
5 changes: 3 additions & 2 deletions src/AccessControl/tests/testSecurityManager.py
Original file line number Diff line number Diff line change
@@ -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):
5 changes: 3 additions & 2 deletions src/AccessControl/tests/testZopeSecurityPolicy.py
Original file line number Diff line number Diff line change
@@ -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(

0 comments on commit 94282bd

Please sign in to comment.