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 f15dc3e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fixed `test_syntax.py::test_from_path_lexer_override` test failure on PyPy3 https://github.com/Textualize/rich/pull/1904
- Fixed test failures on PyPy3 https://github.com/Textualize/rich/pull/1904

## [11.1.0] - 2022-01-28

Expand Down
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 f15dc3e

Please sign in to comment.