Skip to content

Commit

Permalink
Respect PURE_PYTHON=0 environment variable
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 committed Sep 30, 2024
1 parent 4779653 commit 90010a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ For changes before version 3.0, see ``HISTORY.rst``.
7.1 (unreleased)
----------------

- Understand ``PURE_PYTHON`` environment variable set to ``0``.


7.0 (2024-05-30)
----------------
Expand Down
2 changes: 1 addition & 1 deletion src/AccessControl/tests/testSecurityManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ 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):
Expand Down
2 changes: 1 addition & 1 deletion src/AccessControl/tests/testZopeSecurityPolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 90010a4

Please sign in to comment.