- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BUG] 13.1.0: pytest is failing in two units #2757
Comments
What tests are failing? |
My fault. By mistake I forgot include pytest output. + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-rich-13.1.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-rich-13.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/rich-13.1.0, configfile: pyproject.toml, testpaths: tests
collected 791 items
tests/test_align.py ................ [ 2%]
tests/test_ansi.py .. [ 2%]
tests/test_bar.py ....... [ 3%]
tests/test_block_bar.py .... [ 3%]
tests/test_box.py ...... [ 4%]
tests/test_card.py . [ 4%]
tests/test_cells.py ... [ 4%]
tests/test_color.py ................. [ 7%]
tests/test_color_triplet.py ... [ 7%]
tests/test_columns.py . [ 7%]
tests/test_columns_align.py . [ 7%]
tests/test_console.py ................................................................................................. [ 19%]
tests/test_constrain.py . [ 20%]
tests/test_containers.py .... [ 20%]
tests/test_control.py ....... [ 21%]
tests/test_emoji.py ...... [ 22%]
tests/test_file_proxy.py ... [ 22%]
tests/test_filesize.py .. [ 22%]
tests/test_getfileno.py ... [ 23%]
tests/test_highlighter.py ............................................................................... [ 33%]
tests/test_inspect.py ....s....ss.................................. [ 38%]
tests/test_json.py . [ 39%]
tests/test_jupyter.py ... [ 39%]
tests/test_layout.py ...... [ 40%]
tests/test_live.py .......... [ 41%]
tests/test_live_render.py .... [ 41%]
tests/test_log.py ... [ 42%]
tests/test_logging.py .... [ 42%]
tests/test_markdown.py .. [ 43%]
tests/test_markdown_no_hyperlinks.py . [ 43%]
tests/test_markup.py .................... [ 45%]
tests/test_measure.py .... [ 46%]
tests/test_null_file.py . [ 46%]
tests/test_padding.py ..... [ 47%]
tests/test_palette.py . [ 47%]
tests/test_panel.py .......... [ 48%]
tests/test_pick.py . [ 48%]
tests/test_pretty.py ............................................s..... [ 54%]
tests/test_progress.py ...................................... [ 59%]
tests/test_prompt.py ...... [ 60%]
tests/test_protocol.py ...... [ 61%]
tests/test_ratio.py ....... [ 62%]
tests/test_repr.py ........ [ 63%]
tests/test_rich_print.py ....... [ 63%]
tests/test_rule.py ................ [ 65%]
tests/test_rule_in_table.py .... [ 66%]
tests/test_screen.py . [ 66%]
tests/test_segment.py ................................................. [ 72%]
tests/test_spinner.py ..... [ 73%]
tests/test_stack.py . [ 73%]
tests/test_status.py .. [ 73%]
tests/test_style.py ......................... [ 76%]
tests/test_styled.py . [ 77%]
tests/test_syntax.py ....FF................. [ 80%]
tests/test_table.py ............... [ 81%]
tests/test_text.py ......................................................................................... [ 93%]
tests/test_theme.py ..... [ 93%]
tests/test_tools.py .... [ 94%]
tests/test_traceback.py ................... [ 96%]
tests/test_tree.py .....s.s. [ 97%]
tests/test_windows_renderer.py sssssssssssssssss [100%]
========================================================================================= FAILURES ==========================================================================================
__________________________________________________________________________ test_python_render_simple_indent_guides __________________________________________________________________________
def test_python_render_simple_indent_guides():
syntax = Syntax(
CODE,
lexer="python",
line_numbers=False,
theme="ansi_light",
code_width=60,
word_wrap=False,
indent_guides=True,
)
rendered_syntax = render(syntax)
print(repr(rendered_syntax))
expected = '\x1b[34mdef\x1b[0m \x1b[32mloop_first_last\x1b[0m(values: Iterable[T]) -> Iterable[Tuple[\x1b[36mb\x1b[0m\n\x1b[2m│ \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│ \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n\x1b[2m│ \x1b[0m\x1b[34mtry\x1b[0m:\n\x1b[2m│ │ \x1b[0mprevious_value = \x1b[36mnext\x1b[0m(iter_values)\n\x1b[2m│ \x1b[0m\x1b[34mexcept\x1b[0m \x1b[36mStopIteration\x1b[0m:\n\x1b[2m│ │ \x1b[0m\x1b[34mreturn\x1b[0m\n\x1b[2m│ \x1b[0mfirst = \x1b[34mTrue\x1b[0m\n\x1b[2m│ \x1b[0m\x1b[34mfor\x1b[0m value \x1b[35min\x1b[0m iter_values:\n\x1b[2m│ │ \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mFalse\x1b[0m, previous_value\n\x1b[2m│ │ \x1b[0mfirst = \x1b[34mFalse\x1b[0m\n\x1b[2m│ │ \x1b[0mprevious_value = value\n\x1b[2m│ \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mTrue\x1b[0m, previous_value\n'
> assert rendered_syntax == expected
E assert '\x1b[34mdef\...vious_value\n' == '\x1b[34mdef\...vious_value\n'
E Skipping 81 identical leading characters in diff, use -v to show
E mb
E - │ """Iterate and generate a tuple with a flag for first an
E + │ """Iterate and generate a tuple with a flag for first an
E ? +++
E │ iter_values = iter(values)
E │ try:...
E
E ...Full output truncated (10 lines hidden), use '-vv' to show
tests/test_syntax.py:114: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
'\x1b[34mdef\x1b[0m \x1b[32mloop_first_last\x1b[0m(values: Iterable[T]) -> Iterable[Tuple[\x1b[36mb\x1b[0m\n\x1b[2;37m│ \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│ \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n\x1b[2m│ \x1b[0m\x1b[34mtry\x1b[0m:\n\x1b[2m│ │ \x1b[0mprevious_value = \x1b[36mnext\x1b[0m(iter_values)\n\x1b[2m│ \x1b[0m\x1b[34mexcept\x1b[0m \x1b[36mStopIteration\x1b[0m:\n\x1b[2m│ │ \x1b[0m\x1b[34mreturn\x1b[0m\n\x1b[2m│ \x1b[0mfirst = \x1b[34mTrue\x1b[0m\n\x1b[2m│ \x1b[0m\x1b[34mfor\x1b[0m value \x1b[35min\x1b[0m iter_values:\n\x1b[2m│ │ \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mFalse\x1b[0m, previous_value\n\x1b[2m│ │ \x1b[0mfirst = \x1b[34mFalse\x1b[0m\n\x1b[2m│ │ \x1b[0mprevious_value = value\n\x1b[2m│ \x1b[0m\x1b[34myield\x1b[0m first, \x1b[34mTrue\x1b[0m, previous_value\n'
________________________________________________________________________ test_python_render_line_range_indent_guides ________________________________________________________________________
def test_python_render_line_range_indent_guides():
syntax = Syntax(
CODE,
lexer="python",
line_numbers=False,
theme="ansi_light",
code_width=60,
word_wrap=False,
line_range=(2, 3),
indent_guides=True,
)
rendered_syntax = render(syntax)
print(repr(rendered_syntax))
expected = '\x1b[2m│ \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│ \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n'
> assert rendered_syntax == expected
E assert '\x1b[2;37m│ ...[0m(values)\n' == '\x1b[2m│ \...[0m(values)\n'
E - │ """Iterate and generate a tuple with a flag for first an
E + │ """Iterate and generate a tuple with a flag for first an
E ? +++
E │ iter_values = iter(values)
tests/test_syntax.py:131: AssertionError
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
'\x1b[2;37m│ \x1b[0m\x1b[33m"""Iterate and generate a tuple with a flag for first an\x1b[0m\n\x1b[2m│ \x1b[0miter_values = \x1b[36miter\x1b[0m(values)\n'
================================================================================== short test summary info ==================================================================================
SKIPPED [1] tests/test_inspect.py:156: print builtin signature only available on 3.11+
SKIPPED [1] tests/test_inspect.py:248: rendered differently on py3.8
SKIPPED [1] tests/test_inspect.py:289: rendered differently on py3.8
SKIPPED [1] tests/test_pretty.py:629: rendered differently on py3.8
SKIPPED [1] tests/test_tree.py:81: Windows specific
SKIPPED [1] tests/test_tree.py:121: Windows specific
SKIPPED [1] tests/test_windows_renderer.py:23: windows only
SKIPPED [1] tests/test_windows_renderer.py:31: windows only
SKIPPED [1] tests/test_windows_renderer.py:41: windows only
SKIPPED [1] tests/test_windows_renderer.py:51: windows only
SKIPPED [1] tests/test_windows_renderer.py:61: windows only
SKIPPED [1] tests/test_windows_renderer.py:69: windows only
SKIPPED [4] tests/test_windows_renderer.py:77: windows only
SKIPPED [3] tests/test_windows_renderer.py:96: windows only
SKIPPED [1] tests/test_windows_renderer.py:112: windows only
SKIPPED [1] tests/test_windows_renderer.py:120: windows only
SKIPPED [1] tests/test_windows_renderer.py:128: windows only
SKIPPED [1] tests/test_windows_renderer.py:136: windows only
FAILED tests/test_syntax.py::test_python_render_simple_indent_guides - assert '\x1b[34mdef\...vious_value\n' == '\x1b[34mdef\...vious_value\n'
FAILED tests/test_syntax.py::test_python_render_line_range_indent_guides - assert '\x1b[2;37m│ ...[0m(values)\n' == '\x1b[2m│ \...[0m(values)\n'
========================================================================= 2 failed, 766 passed, 23 skipped in 6.37s ========================================================================= |
Same tests are failing on the new version 3.2.0 Full output of pytest -vv is here https://pastebin.ubuntu.com/p/QHqJYyzdTp/ |
what i think it's happening is that rich tests have been adjusted for pygments 2.14, but the system where OP sees the errors are still running 2.13 (or lower) |
I'm during of full rebuild of my disribution. |
13.3.0 bumps pygments. |
I hope we solved your problem. If you like using Rich, you might also enjoy Textual |
Describe the bug
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
The text was updated successfully, but these errors were encountered: