Fix test_inspect failures on PyPy3

Mark the test_inspect tests failing on PyPy3 due to different output
to be skipped appropriately.
This commit is contained in:
Michał Górny 2022-02-01 15:10:32 +01:00
parent 8e3a0be6fb
commit f15dc3ea0b
2 changed files with 10 additions and 1 deletions

View file

@ -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

View file

@ -32,6 +32,11 @@ skip_py310 = pytest.mark.skipif(
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 = (
"╭──────────────── <class 'str'> ─────────────────╮\n"
@ -98,6 +104,7 @@ def test_inspect_text():
@skip_py36
@skip_py37
@skip_pypy3
def test_inspect_empty_dict():
expected = (
"╭──────────────── <class 'dict'> ────────────────╮\n"
@ -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"
@ -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