diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c402913..d9528f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,10 @@ jobs: - os: ubuntu-latest python-version: "3.10" deps: test + # Tests latest development Python version + - os: ubuntu-latest + python-version: "3.11-dev" + deps: test steps: - uses: actions/checkout@v2 diff --git a/IPython/core/tests/test_completer.py b/IPython/core/tests/test_completer.py index 4707150..c470b1f 100644 --- a/IPython/core/tests/test_completer.py +++ b/IPython/core/tests/test_completer.py @@ -104,7 +104,7 @@ def test_unicode_range(): assert len_exp == len_test, message # fail if new unicode symbols have been added. - assert len_exp <= 137714, message + assert len_exp <= 138552, message @contextmanager @@ -219,6 +219,11 @@ class KeyCompletable: return list(self.things) +@pytest.mark.xfail( + sys.version_info >= (3, 11), + reason="parso does not support 3.11 yet", + raises=NotImplementedError, +) class TestCompleter(unittest.TestCase): def setUp(self): """ @@ -282,7 +287,7 @@ class TestCompleter(unittest.TestCase): ip = get_ipython() # Test some random unicode symbols - keys = random.sample(latex_symbols.keys(), 10) + keys = random.sample(sorted(latex_symbols), 10) for k in keys: text, matches = ip.complete(k) self.assertEqual(text, k) diff --git a/IPython/core/tests/test_inputsplitter.py b/IPython/core/tests/test_inputsplitter.py index 46c804a..ec000a2 100644 --- a/IPython/core/tests/test_inputsplitter.py +++ b/IPython/core/tests/test_inputsplitter.py @@ -6,13 +6,13 @@ # Distributed under the terms of the Modified BSD License. import unittest +import pytest import sys from IPython.core import inputsplitter as isp from IPython.core.inputtransformer import InputTransformer from IPython.core.tests.test_inputtransformer import syntax, syntax_ml from IPython.testing import tools as tt -from IPython.testing.decorators import skipif #----------------------------------------------------------------------------- # Semi-complete examples (also used as tests) @@ -318,7 +318,12 @@ class InputSplitterTestCase(unittest.TestCase): self.isp.push(u'\xc3\xa9') self.isp.push(u"u'\xc3\xa9'") - @skipif(sys.version_info[:3] == (3, 9, 8)) + @pytest.mark.xfail( + reason="Bug in python 3.9.8 – bpo 45738", + condition=sys.version_info in [(3, 9, 8, "final", 0), (3, 11, 0, "alpha", 2)], + raises=SystemError, + strict=True, + ) def test_line_continuation(self): """ Test issue #2108.""" isp = self.isp diff --git a/IPython/core/tests/test_inputtransformer2.py b/IPython/core/tests/test_inputtransformer2.py index b00d1a8..4a2306a 100644 --- a/IPython/core/tests/test_inputtransformer2.py +++ b/IPython/core/tests/test_inputtransformer2.py @@ -276,7 +276,8 @@ examples = [ None, marks=pytest.mark.xfail( reason="Bug in python 3.9.8 – bpo 45738", - condition=sys.version_info[:3] == (3, 9, 8), + condition=sys.version_info + in [(3, 9, 8, "final", 0), (3, 11, 0, "alpha", 2)], raises=SystemError, strict=True, ), @@ -295,7 +296,9 @@ def test_check_complete_param(code, expected, number): @skip_iptest_but_not_pytest @pytest.mark.xfail( reason="Bug in python 3.9.8 – bpo 45738", - condition=sys.version_info[:3] == (3, 9, 8), + condition=sys.version_info in [(3, 9, 8, "final", 0), (3, 11, 0, "alpha", 2)], + raises=SystemError, + strict=True, ) def test_check_complete(): cc = ipt2.TransformerManager().check_complete diff --git a/IPython/core/tests/test_oinspect.py b/IPython/core/tests/test_oinspect.py index 7557fcf..58d07db 100644 --- a/IPython/core/tests/test_oinspect.py +++ b/IPython/core/tests/test_oinspect.py @@ -269,7 +269,6 @@ def test_empty_property_has_no_source(): def test_property_sources(): - import posixpath # A simple adder whose source and signature stays # the same across Python distributions def simple_add(a, b): @@ -283,7 +282,7 @@ def test_property_sources(): foo = foo.setter(lambda self, v: setattr(self, 'bar', v)) - dname = property(posixpath.dirname) + dname = property(oinspect.getdoc) adder = property(simple_add) i = inspector.info(A.foo, detail_level=1) @@ -291,7 +290,7 @@ def test_property_sources(): assert "lambda self, v:" in i["source"] i = inspector.info(A.dname, detail_level=1) - assert "def dirname(p)" in i["source"] + assert "def getdoc(obj)" in i["source"] i = inspector.info(A.adder, detail_level=1) assert "def simple_add(a, b)" in i["source"]