From aacbcf96640ccd81569fe30b89b99ed888e83cf9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 29 Jan 2023 20:09:00 +0000 Subject: Skip recursion test on PyPy (#1987) (#1988) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com> (cherry picked from commit c1e4c95b0d6e555a92484183b89be683dfbde458) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- tests/unittest_inference.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/unittest_inference.py b/tests/unittest_inference.py index 13514570..e66103d9 100644 --- a/tests/unittest_inference.py +++ b/tests/unittest_inference.py @@ -23,7 +23,7 @@ from astroid import helpers, nodes, objects, test_utils, util from astroid.arguments import CallSite from astroid.bases import BoundMethod, Instance, UnboundMethod from astroid.builder import AstroidBuilder, _extract_single_node, extract_node, parse -from astroid.const import PY38_PLUS, PY39_PLUS +from astroid.const import IS_PYPY, PY38_PLUS, PY39_PLUS from astroid.context import InferenceContext from astroid.exceptions import ( AstroidTypeError, @@ -6820,10 +6820,18 @@ def test_imported_module_var_inferable3() -> None: assert i_w_val.as_string() == "['w', 'v']" +@pytest.mark.skipif( + IS_PYPY, reason="Test run with coverage on PyPy sometimes raises a RecursionError" +) def test_recursion_on_inference_tip() -> None: """Regression test for recursion in inference tip. Originally reported in https://github.com/PyCQA/pylint/issues/5408. + + When run on PyPy with coverage enabled, the test can sometimes raise a RecursionError + outside of the code that we actually want to test. + As the issue seems to be with coverage, skip the test on PyPy. + https://github.com/PyCQA/astroid/pull/1984#issuecomment-1407720311 """ code = """ class MyInnerClass: -- cgit v1.2.1