Skip to content

Commit

Permalink
Fix test_inspect failures on PyPy3
Browse files Browse the repository at this point in the history
Mark the test_inspect tests failing on PyPy3 due to different output
to be skipped appropriately.
  • Loading branch information
mgorny committed Feb 1, 2022
1 parent 8e3a0be commit 6208b03
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_inspect.py
Expand Up @@ -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)
Expand Down Expand Up @@ -81,6 +86,7 @@ def test_render():
assert expected == result


@skip_pypy3
def test_inspect_text():
expected = (
"╭──────────────── <class 'str'> ─────────────────╮\n"
Expand All @@ -98,6 +104,7 @@ def test_inspect_text():

@skip_py36
@skip_py37
@skip_pypy3
def test_inspect_empty_dict():
expected = (
"╭──────────────── <class 'dict'> ────────────────╮\n"
Expand All @@ -119,6 +126,7 @@ def test_inspect_empty_dict():
assert render({}).startswith(expected)


@skip_pypy3
def test_inspect_builtin_function():
expected = (
"╭────────── <built-in function print> ───────────╮\n"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6208b03

Please sign in to comment.