From ddb8a15a934f3946929eaae0a137474db0a83af8 2024-01-19 13:25:38 From: M Bussonnier Date: 2024-01-19 13:25:38 Subject: [PATCH] Skip test on problematic PyPy versions (#14295) See pypy/pypy#4860 --- diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index c99044e..378a3cd 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -577,8 +577,12 @@ class InteractiveShellTestCase(unittest.TestCase): self.assertEqual(res.success, True) +@pytest.mark.skipif( + sys.implementation.name == "pypy" + and ((7, 3, 13) < sys.implementation.version < (7, 3, 16)), + reason="Unicode issues with scandir on PyPy, see https://github.com/pypy/pypy/issues/4860", +) class TestSafeExecfileNonAsciiPath(unittest.TestCase): - @onlyif_unicode_paths def setUp(self): self.BASETESTDIR = tempfile.mkdtemp() diff --git a/IPython/core/tests/test_profile.py b/IPython/core/tests/test_profile.py index 876c7fd..8e03b5a 100644 --- a/IPython/core/tests/test_profile.py +++ b/IPython/core/tests/test_profile.py @@ -24,9 +24,10 @@ import shutil import sys import tempfile from pathlib import Path +from tempfile import TemporaryDirectory from unittest import TestCase -from tempfile import TemporaryDirectory +import pytest from IPython.core.profileapp import list_bundled_profiles, list_profiles_in from IPython.core.profiledir import ProfileDir @@ -101,6 +102,11 @@ class ProfileStartupTest(TestCase): self.validate('Exception reporting mode: Plain') +@pytest.mark.skipif( + sys.implementation.name == "pypy" + and ((7, 3, 13) < sys.implementation.version < (7, 3, 16)), + reason="Unicode issues with scandir on PyPy, see https://github.com/pypy/pypy/issues/4860", +) def test_list_profiles_in(): # No need to remove these directories and files, as they will get nuked in # the module-level teardown. diff --git a/IPython/utils/tests/test_io.py b/IPython/utils/tests/test_io.py index 75d895e..97a768e 100644 --- a/IPython/utils/tests/test_io.py +++ b/IPython/utils/tests/test_io.py @@ -20,6 +20,7 @@ def test_tee_simple(): tee = Tee(chan, channel='stdout') print(text, file=chan) assert chan.getvalue() == text + "\n" + tee.close() class TeeTestCase(unittest.TestCase):