Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyPy3 test fixes #1904

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add support for US spelling of "gray" in ANSI color names https://github.com/Textualize/rich/issues/1890

### Fixed

- Fixed test failures on PyPy3 https://github.com/Textualize/rich/pull/1904

## [11.1.0] - 2022-01-28

### Added
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ The following people have contributed to the development of Rich:
- [Nicolas Simonds](https://github.com/0xDEC0DE)
- [Gabriele N. Tornetta](https://github.com/p403n1x87)
- [Patrick Arminio](https://github.com/patrick91)
- [Michał Górny](https://github.com/mgorny)
9 changes: 9 additions & 0 deletions tests/test_inspect.py
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion tests/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def test_from_path_lexer_override():
try:
os.write(fh, b"import this\n")
syntax = Syntax.from_path(path, lexer="rust")
assert syntax.lexer.name is "Rust"
assert syntax.lexer.name == "Rust"
assert syntax.code == "import this\n"
finally:
os.remove(path)
Expand Down