From 982c92a9ea2afaa2e7a0dbb703ed57c4d6dc4512 2024-06-26 12:38:22 From: M Bussonnier Date: 2024-06-26 12:38:22 Subject: [PATCH] stricted but no doctests --- diff --git a/IPython/core/tests/test_completer.py b/IPython/core/tests/test_completer.py index e2e6ec0..4513d40 100644 --- a/IPython/core/tests/test_completer.py +++ b/IPython/core/tests/test_completer.py @@ -10,6 +10,9 @@ import sys import textwrap import unittest +from importlib.metadata import version + + from contextlib import contextmanager from traitlets.config.loader import Config @@ -30,6 +33,9 @@ from IPython.core.completer import ( CompletionContext, ) +from packaging.version import parse + + # ----------------------------------------------------------------------------- # Test functions # ----------------------------------------------------------------------------- @@ -531,7 +537,9 @@ class TestCompleter(unittest.TestCase): c = next(completions) # should be `%time` or similar assert c.type == "magic", "Type of magic was not assigned by completer" - @pytest.mark.xfail(reason="Known failure on jedi<=0.18.0") + @pytest.mark.xfail( + parse(version("jedi")) > parse("0.18.0"), reason="Known failure on jedi<=0.18.0" + ) def test_deduplicate_completions(self): """ Test that completions are correctly deduplicated (even if ranges are not the same) diff --git a/IPython/core/tests/test_debugger.py b/IPython/core/tests/test_debugger.py index 6983396..b22be92 100644 --- a/IPython/core/tests/test_debugger.py +++ b/IPython/core/tests/test_debugger.py @@ -54,10 +54,6 @@ class PdbTestInput(object): # Tests #----------------------------------------------------------------------------- -@pytest.mark.xfail( - sys.version_info.releaselevel not in ("final", "candidate"), - reason="fails on 3.13.dev", -) def test_ipdb_magics(): '''Test calling some IPython magics from ipdb. @@ -454,6 +450,7 @@ def test_decorator_skip_disabled(): @pytest.mark.xfail( sys.version_info.releaselevel not in ("final", "candidate"), reason="fails on 3.13.dev", + strict=True, ) @pytest.mark.skipif(platform.python_implementation() == "PyPy", reason="issues on PyPy") @skip_win32 diff --git a/IPython/core/tests/test_oinspect.py b/IPython/core/tests/test_oinspect.py index 4cb9268..3decb8b 100644 --- a/IPython/core/tests/test_oinspect.py +++ b/IPython/core/tests/test_oinspect.py @@ -491,6 +491,7 @@ def test_pinfo_docstring_if_detail_and_no_source(): @pytest.mark.xfail( sys.version_info.releaselevel not in ("final", "candidate"), reason="fails on 3.13.dev", + strict=True, ) def test_pinfo_docstring_dynamic(capsys): obj_def = """class Bar: diff --git a/pyproject.toml b/pyproject.toml index d6cf19b..1dfda30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,6 +99,7 @@ test = [ "pytest-asyncio<0.22", "testpath", "pickleshare", + "packaging", ] test_extra = [ "ipython[test]",