Package: src:rich
Version: 13.3.1-2
Severity: important
Tags: sid trixie
User: [email protected]
Usertags: python3.12

rich's autopkg tests fail with Python 3.12:

[...]
287s I: pybuild base:310: cd /tmp/autopkgtest.gNmBcV/autopkgtest_tmp/build; python3.12 -m pytest tests 288s ============================= test session starts ==============================
288s platform linux -- Python 3.12.0+, pytest-7.4.3, pluggy-1.3.0
288s rootdir: /tmp/autopkgtest.gNmBcV/autopkgtest_tmp/build/tests
288s configfile: pytest.ini
288s collected 791 items
288s
289s tests/test_align.py ................ [ 2%] 289s tests/test_ansi.py .. [ 2%] 289s tests/test_bar.py ....... [ 3%] 289s tests/test_block_bar.py .... [ 3%] 289s tests/test_box.py ...... [ 4%] 289s tests/test_card.py . [ 4%] 289s tests/test_cells.py ... [ 4%] 289s tests/test_color.py ................. [ 7%] 289s tests/test_color_triplet.py ... [ 7%] 289s tests/test_columns.py . [ 7%] 289s tests/test_columns_align.py . [ 7%] 289s tests/test_console.py .................................................. [ 14%] 289s ............................................... [ 19%] 289s tests/test_constrain.py . [ 20%] 289s tests/test_containers.py .... [ 20%] 289s tests/test_control.py ....... [ 21%] 289s tests/test_emoji.py ...... [ 22%] 289s tests/test_file_proxy.py ... [ 22%] 289s tests/test_filesize.py .. [ 22%] 289s tests/test_getfileno.py ... [ 23%] 289s tests/test_highlighter.py .............................................. [ 29%] 289s ................................. [ 33%] 289s tests/test_inspect.py ...F....FFF.................................. [ 38%] 289s tests/test_json.py . [ 39%] 289s tests/test_jupyter.py ... [ 39%] 289s tests/test_layout.py ...... [ 40%] 291s tests/test_live.py .......... [ 41%] 291s tests/test_live_render.py .... [ 41%] 291s tests/test_log.py ... [ 42%] 291s tests/test_logging.py .... [ 42%] 291s tests/test_markdown.py .. [ 43%] 291s tests/test_markdown_no_hyperlinks.py . [ 43%] 291s tests/test_markup.py .................... [ 45%] 291s tests/test_measure.py .... [ 46%] 291s tests/test_null_file.py . [ 46%] 291s tests/test_padding.py ..... [ 47%] 291s tests/test_palette.py . [ 47%] 291s tests/test_panel.py .......... [ 48%] 291s tests/test_pick.py . [ 48%] 291s tests/test_pretty.py ...........................................F...... [ 54%] 292s tests/test_progress.py ...................................... [ 59%] 292s tests/test_prompt.py ...... [ 60%] 292s tests/test_protocol.py ...... [ 61%] 292s tests/test_ratio.py ....... [ 62%] 292s tests/test_repr.py ........ [ 63%] 292s tests/test_rich_print.py ....... [ 63%] 292s tests/test_rule.py ................ [ 65%] 292s tests/test_rule_in_table.py .... [ 66%] 292s tests/test_screen.py . [ 66%] 292s tests/test_segment.py ................................................. [ 72%] 292s tests/test_spinner.py ..... [ 73%] 292s tests/test_stack.py . [ 73%] 292s tests/test_status.py .. [ 73%] 292s tests/test_style.py ......................... [ 76%] 292s tests/test_styled.py . [ 77%] 293s tests/test_syntax.py ....................... [ 80%] 293s tests/test_table.py ............... [ 81%] 293s tests/test_text.py ..................................................... [ 88%] 293s .................................... [ 93%] 293s tests/test_theme.py ..... [ 93%] 293s tests/test_tools.py .... [ 94%] 293s tests/test_traceback.py ................... [ 96%] 293s tests/test_tree.py .....s.s. [ 97%] 293s tests/test_windows_renderer.py sssssssssssssssss [100%]
293s
293s =================================== FAILURES =================================== 293s ________________ test_inspect_builtin_function_except_python311 ________________
293s
293s     @skip_py311
293s     @skip_pypy3
293s     def test_inspect_builtin_function_except_python311():
293s # Pre-3.11 Python versions - print builtin has no signature available
293s         expected = (
293s             "╭────────── <built-in function print> ───────────╮\n"
293s             "│ def print(...)                                 │\n"
293s             "│                                                │\n"
293s             "│ print(value, ..., sep=' ', end='\\n',           │\n"
293s             "│ file=sys.stdout, flush=False)                  │\n"
293s             "│                                                │\n"
293s             "│ 29 attribute(s) not shown. Run                 │\n"
293s             "│ inspect(inspect) for options.                  │\n"
293s             "╰────────────────────────────────────────────────╯\n"
293s         )
293s >       assert render(print) == expected
293s E AssertionError: assert '╭────────── ...──────────╯\n' == '╭────────── ...──────────╯\n' 293s E Skipping 53 identical leading characters in diff, use -v to show
293s E         - def print(...)                                 │
293s E         + def print(*args, sep=' ', end='\n', file=None, │
293s E         + │ flush=False):                                  │
293s E           │                                                │
293s E         - │ print(value, ..., sep=' ', end='\n',           │
293s E         - │ file=sys.stdout, flush=False)                  │...
293s E
293s E         ...Full output truncated (9 lines hidden), use '-vv' to show
293s
293s tests/test_inspect.py:153: AssertionError
293s ___________ test_inspect_integer_with_methods_python38_and_python39 ____________
293s
293s     @skip_py37
293s     @skip_py310
293s     @skip_py311
293s     def test_inspect_integer_with_methods_python38_and_python39():
293s         expected = (
293s             "╭──────────────── <class 'int'> ─────────────────╮\n"
293s             "│ int([x]) -> integer                            │\n"
293s             "│ int(x, base=10) -> integer                     │\n"
293s             "│                                                │\n"
293s             "│      denominator = 1                           │\n"
293s             "│             imag = 0                           │\n"
293s             "│        numerator = 1                           │\n"
293s             "│             real = 1                           │\n"
293s             "│ as_integer_ratio = def as_integer_ratio():     │\n"
293s             "│                    Return integer ratio.       │\n"
293s             "│       bit_length = def bit_length(): Number of │\n"
293s             "│                    bits necessary to represent │\n"
293s             "│                    self in binary.             │\n"
293s             "│        conjugate = def conjugate(...) Returns  │\n"
293s             "│                    self, the complex conjugate │\n"
293s             "│                    of any int.                 │\n"
293s             "│       from_bytes = def from_bytes(bytes,       │\n"
293s             "│                    byteorder, *,               │\n"
293s             "│                    signed=False): Return the   │\n"
293s             "│                    integer represented by the  │\n"
293s             "│                    given array of bytes.       │\n"
293s             "│         to_bytes = def to_bytes(length,        │\n"
293s             "│                    byteorder, *,               │\n"
293s             "│                    signed=False): Return an    │\n"
293s             "│                    array of bytes representing │\n"
293s             "│                    an integer.                 │\n"
293s             "╰────────────────────────────────────────────────╯\n"
293s         )
293s >       assert render(1, methods=True) == expected
293s E AssertionError: assert '╭───────────...──────────╯\n' == '╭───────────...──────────╯\n' 293s E Skipping 477 identical leading characters in diff, use -v to show
293s E         -    Return integer ratio.       │
293s E         +    Return a pair of integers,  │
293s E         + │                    whose ratio is equal to the │
293s E         + │                    original int.               │
293s E         + │        bit_count = def bit_count(): Number of  │
293s E         + │                    ones in the binary          │...
293s E
293s E         ...Full output truncated (32 lines hidden), use '-vv' to show
293s
293s tests/test_inspect.py:245: AssertionError
293s _______________ test_inspect_integer_with_methods_python310only ________________
293s
293s     @skip_py37
293s     @skip_py38
293s     @skip_py39
293s     @skip_py311
293s     def test_inspect_integer_with_methods_python310only():
293s         expected = (
293s             "╭──────────────── <class 'int'> ─────────────────╮\n"
293s             "│ int([x]) -> integer                            │\n"
293s             "│ int(x, base=10) -> integer                     │\n"
293s             "│                                                │\n"
293s             "│      denominator = 1                           │\n"
293s             "│             imag = 0                           │\n"
293s             "│        numerator = 1                           │\n"
293s             "│             real = 1                           │\n"
293s             "│ as_integer_ratio = def as_integer_ratio():     │\n"
293s             "│                    Return integer ratio.       │\n"
293s             "│        bit_count = def bit_count(): Number of  │\n"
293s             "│                    ones in the binary          │\n"
293s             "│                    representation of the       │\n"
293s             "│                    absolute value of self.     │\n"
293s             "│       bit_length = def bit_length(): Number of │\n"
293s             "│                    bits necessary to represent │\n"
293s             "│                    self in binary.             │\n"
293s             "│        conjugate = def conjugate(...) Returns  │\n"
293s             "│                    self, the complex conjugate │\n"
293s             "│                    of any int.                 │\n"
293s             "│       from_bytes = def from_bytes(bytes,       │\n"
293s             "│                    byteorder, *,               │\n"
293s             "│                    signed=False): Return the   │\n"
293s             "│                    integer represented by the  │\n"
293s             "│                    given array of bytes.       │\n"
293s             "│         to_bytes = def to_bytes(length,        │\n"
293s             "│                    byteorder, *,               │\n"
293s             "│                    signed=False): Return an    │\n"
293s             "│                    array of bytes representing │\n"
293s             "│                    an integer.                 │\n"
293s             "╰────────────────────────────────────────────────╯\n"
293s         )
293s >       assert render(1, methods=True) == expected
293s E AssertionError: assert '╭───────────...──────────╯\n' == '╭───────────...──────────╯\n' 293s E Skipping 477 identical leading characters in diff, use -v to show
293s E         -    Return integer ratio.       │
293s E         +    Return a pair of integers,  │
293s E         + │                    whose ratio is equal to the │
293s E         + │                    original int.               │
293s E           │        bit_count = def bit_count(): Number of  │
293s E           │                    ones in the binary          │...
293s E
293s E         ...Full output truncated (32 lines hidden), use '-vv' to show
293s
293s tests/test_inspect.py:286: AssertionError
293s ____________ test_inspect_integer_with_methods_python311_and_above _____________
293s
293s     @skip_py37
293s     @skip_py38
293s     @skip_py39
293s     @skip_py310
293s     def test_inspect_integer_with_methods_python311_and_above():
293s # to_bytes and from_bytes methods on int had minor signature change - 293s # they now, as of 3.11, have default values for all of their parameters
293s         expected = (
293s             "╭──────────────── <class 'int'> ─────────────────╮\n"
293s             "│ int([x]) -> integer                            │\n"
293s             "│ int(x, base=10) -> integer                     │\n"
293s             "│                                                │\n"
293s             "│      denominator = 1                           │\n"
293s             "│             imag = 0                           │\n"
293s             "│        numerator = 1                           │\n"
293s             "│             real = 1                           │\n"
293s             "│ as_integer_ratio = def as_integer_ratio():     │\n"
293s             "│                    Return integer ratio.       │\n"
293s             "│        bit_count = def bit_count(): Number of  │\n"
293s             "│                    ones in the binary          │\n"
293s             "│                    representation of the       │\n"
293s             "│                    absolute value of self.     │\n"
293s             "│       bit_length = def bit_length(): Number of │\n"
293s             "│                    bits necessary to represent │\n"
293s             "│                    self in binary.             │\n"
293s             "│        conjugate = def conjugate(...) Returns  │\n"
293s             "│                    self, the complex conjugate │\n"
293s             "│                    of any int.                 │\n"
293s             "│       from_bytes = def from_bytes(bytes,       │\n"
293s             "│                    byteorder='big', *,         │\n"
293s             "│                    signed=False): Return the   │\n"
293s             "│                    integer represented by the  │\n"
293s             "│                    given array of bytes.       │\n"
293s             "│         to_bytes = def to_bytes(length=1,      │\n"
293s             "│                    byteorder='big', *,         │\n"
293s             "│                    signed=False): Return an    │\n"
293s             "│                    array of bytes representing │\n"
293s             "│                    an integer.                 │\n"
293s             "╰────────────────────────────────────────────────╯\n"
293s         )
293s >       assert render(1, methods=True) == expected
293s E AssertionError: assert '╭───────────...──────────╯\n' == '╭───────────...──────────╯\n' 293s E Skipping 477 identical leading characters in diff, use -v to show
293s E         -    Return integer ratio.       │
293s E         +    Return a pair of integers,  │
293s E         + │                    whose ratio is equal to the │
293s E         + │                    original int.               │
293s E           │        bit_count = def bit_count(): Number of  │
293s E           │                    ones in the binary          │...
293s E
293s E         ...Full output truncated (23 lines hidden), use '-vv' to show
293s
293s tests/test_inspect.py:329: AssertionError
293s ______________________________ test_attrs_broken _______________________________
293s
293s     @skip_py310
293s     @skip_py311
293s     def test_attrs_broken():
293s         @attr.define
293s         class Foo:
293s             bar: int
293s
293s         foo = Foo(1)
293s         del foo.bar
293s         result = pretty_repr(foo)
293s         print(repr(result))
293s         expected = "Foo(bar=AttributeError('bar'))"
293s >       assert result == expected
293s E assert 'Foo(bar=Attr...te \'bar\'"))' == "Foo(bar=Attr...Error('bar'))"
293s E         - Foo(bar=AttributeError('bar'))
293s E + Foo(bar=AttributeError("'Foo' object has no attribute 'bar'"))
293s
293s tests/test_pretty.py:626: AssertionError
293s ----------------------------- Captured stdout call -----------------------------
293s 'Foo(bar=AttributeError("\'Foo\' object has no attribute \'bar\'"))'
293s =========================== short test summary info ============================ 293s FAILED tests/test_inspect.py::test_inspect_builtin_function_except_python311 293s FAILED tests/test_inspect.py::test_inspect_integer_with_methods_python38_and_python39 293s FAILED tests/test_inspect.py::test_inspect_integer_with_methods_python310only 293s FAILED tests/test_inspect.py::test_inspect_integer_with_methods_python311_and_above 293s FAILED tests/test_pretty.py::test_attrs_broken - assert 'Foo(bar=Attr...te \'... 293s ================== 5 failed, 767 passed, 19 skipped in 6.22s =================== 294s E: pybuild pybuild:395: test: plugin pyproject failed with: exit code=1: cd /tmp/autopkgtest.gNmBcV/autopkgtest_tmp/build; python3.12 -m pytest tests

Reply via email to