Skip to content

Commit

Permalink
option does not fully work for PyPy -- disable corresponding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d-maurer committed Apr 25, 2022
1 parent 77eb791 commit 132c98a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/zope/testrunner/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ def _regex_search(s):
help="""\
After each test, call 'gc.collect' and record the return
value *rv*; when *rv* is non-zero, output '!' on verbosity level 1
and '[*rv*]' on higher verbosity levels.
and '[*rv*]' on higher verbosity levels.\n
Note: the option does not work under `jython` and not fully works
under `PyPy`.
""")

analysis.add_argument(
Expand Down
7 changes: 6 additions & 1 deletion src/zope/testrunner/tests/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import doctest
import gc
import os
import platform
import re
import sys
import unittest
Expand All @@ -27,6 +28,7 @@

from ..runner import is_jython

is_pypy = platform.python_implementation() == "PyPy"

# separated checkers for the different platform,
# because it s...s to maintain just one
Expand Down Expand Up @@ -387,7 +389,10 @@ def test_suite():
checker=checker,
)
)
if not is_jython:
if not is_jython and not is_pypy:
# ``Jython`` apparently does not implement ``gc``
# and for ``PyPy``, ``gc.collect`` returns ``None``
# rather than the number of collected objects
suites.append(
doctest.DocFileSuite(
'testrunner-gc-after-test.rst',
Expand Down

0 comments on commit 132c98a

Please sign in to comment.