Closed befeleme closed 1 month ago
Describe the bug
3 of test_pretty fail with Python 3.13.0b1:
test_pretty
=================================== FAILURES =================================== ____________________________ test_pretty_dataclass _____________________________ def test_pretty_dataclass(): dc = ExampleDataclass(1000, "Hello, World", 999, ["foo", "bar", "baz"]) result = pretty_repr(dc, max_width=80) print(repr(result)) assert ( result == "ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 'bar', 'baz'])" ) result = pretty_repr(dc, max_width=16) print(repr(result)) > assert ( result == "ExampleDataclass(\n foo=1000,\n bar='Hello, World',\n baz=[\n 'foo',\n 'bar',\n 'baz'\n ]\n)" ) E assert "ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 'bar', 'baz'])" == "ExampleDataclass(\n foo=1000,\n bar='Hello, World',\n baz=[\n 'foo',\n 'bar',\n 'baz'\n ]\n)" E + ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 'bar', 'baz']) E - ExampleDataclass( E - foo=1000, E - bar='Hello, World', E - baz=[ E - 'foo', E - 'bar', E - 'baz' E - ] E - ) tests/test_pretty.py:184: AssertionError ----------------------------- Captured stdout call ----------------------------- "ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 'bar', 'baz'])" "ExampleDataclass(foo=1000, bar='Hello, World', baz=['foo', 'bar', 'baz'])" ________________________ test_reference_cycle_dataclass ________________________ def test_reference_cycle_dataclass(): @dataclass class Example: x: int y: Any test = Example(1, None) test.y = test res = pretty_repr(test) > assert res == "Example(x=1, y=...)" E AssertionError: assert 'test_reference_cycle_dataclass.<locals>.Example(x=1, y=...)' == 'Example(x=1, y=...)' E - Example(x=1, y=...) E + test_reference_cycle_dataclass.<locals>.Example(x=1, y=...) tests/test_pretty.py:356: AssertionError ___________________________ test_max_depth_dataclass ___________________________ def test_max_depth_dataclass(): @dataclass class Foo: foo: object @dataclass class Bar: bar: object > assert ( pretty_repr(Foo(foo=Bar(bar=Foo(foo=[]))), max_depth=2) == "Foo(foo=Bar(bar=Foo(...)))" ) E AssertionError: assert 'test_max_depth_dataclass.<locals>.Foo(foo=test_max_depth_dataclass.<locals>.Bar(bar=test_max_depth_dataclass.<locals>.Foo(foo=[])))' == 'Foo(foo=Bar(bar=Foo(...)))' E - Foo(foo=Bar(bar=Foo(...))) E + test_max_depth_dataclass.<locals>.Foo(foo=test_max_depth_dataclass.<locals>.Bar(bar=test_max_depth_dataclass.<locals>.Foo(foo=[]))) tests/test_pretty.py:487: AssertionError =========================== short test summary info ============================ FAILED tests/test_pretty.py::test_pretty_dataclass - assert "ExampleDataclass... FAILED tests/test_pretty.py::test_reference_cycle_dataclass - AssertionError:... FAILED tests/test_pretty.py::test_max_depth_dataclass - AssertionError: asser... ============= 3 failed, 799 passed, 24 skipped, 1 warning in 4.76s =============
Edit this with a clear and concise description of what the bug.
Provide a minimal code example that demonstrates the issue if you can. If the issue is visual in nature, consider posting a screenshot.
Platform
Thank you for your issue. Give us a little time to review it.
PS. You might want to check the FAQ if you haven't done so already.
This is an automated reply, generated by FAQtory
I hope we solved your problem.
If you like using Rich, you might also enjoy Textual
Describe the bug
3 of
test_pretty
fail with Python 3.13.0b1:Edit this with a clear and concise description of what the bug.
Provide a minimal code example that demonstrates the issue if you can. If the issue is visual in nature, consider posting a screenshot.
Platform
Click to expand
Fedora Linux 41