From 6208b03268484df7bb6ddb02bc4dc8e50b9f82e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 1 Feb 2022 15:10:32 +0100 Subject: [PATCH] Fix test_inspect failures on PyPy3 Mark the test_inspect tests failing on PyPy3 due to different output to be skipped appropriately. --- tests/test_inspect.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_inspect.py b/tests/test_inspect.py index 63c5f06244..b4c1d2a709 100644 --- a/tests/test_inspect.py +++ b/tests/test_inspect.py @@ -32,6 +32,11 @@ reason="rendered differently on py3.10", ) +skip_pypy3 = pytest.mark.skipif( + hasattr(sys, "pypy_version_info"), + reason="rendered differently on pypy3", +) + def render(obj, methods=False, value=False, width=50) -> str: console = Console(file=io.StringIO(), width=width, legacy_windows=False) @@ -81,6 +86,7 @@ def test_render(): assert expected == result +@skip_pypy3 def test_inspect_text(): expected = ( "╭──────────────── ─────────────────╮\n" @@ -98,6 +104,7 @@ def test_inspect_text(): @skip_py36 @skip_py37 +@skip_pypy3 def test_inspect_empty_dict(): expected = ( "╭──────────────── ────────────────╮\n" @@ -119,6 +126,7 @@ def test_inspect_empty_dict(): assert render({}).startswith(expected) +@skip_pypy3 def test_inspect_builtin_function(): expected = ( "╭────────── ───────────╮\n" @@ -237,6 +245,7 @@ def test_inspect_integer_with_methods(): @skip_py36 @skip_py37 +@skip_pypy3 def test_broken_call_attr(): class NotCallable: __call__ = 5 # Passes callable() but isn't really callable