systemd 245 + prompt_toolkit 1.0.x failing test_with_style

Open
#1,046 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start with tests/test_print_tokens.py and reproduce test_with_style on a system using systemd-245 and prompt_toolkit 1.0.x. Trace the generated terminal output against the expected escape sequence in the test. Done means the cause is addressed and the test suite no longer reports this failure.

Written by the indexing model from the issue text.

Description

on system with systemd-245 testsuite fails with:

[  105s] _______________________________ test_with_style ________________________________
[  105s] 
[  105s]     def test_with_style():
[  105s]         f = _Capture()
[  105s]         style = style_from_dict({
[  105s]             Token.Hello: '#ff0066',
[  105s]             Token.World: '#44ff44 italic',
[  105s]         })
[  105s]         tokens = [
[  105s]             (Token.Hello, 'Hello '),
[  105s]             (Token.World, 'world'),
[  105s]         ]
[  105s]         print_tokens(tokens, style=style, file=f)
[  105s] >       assert b'\x1b[0;38;5;197mHello' in f.data
[  105s] E       AssertionError: assert '\x1b[0;38;5;197mHello' in '\x1b[0m\x1b[?7h\x1b[0;91mHello \x1b[0;92;3mworld\x1b[0m'
[  105s] E        +  where '\x1b[0m\x1b[?7h\x1b[0;91mHello \x1b[0;92;3mworld\x1b[0m' = <test_print_tokens._Capture instance at 0x7f88f75a1aa0>.data
[  105s] 
[  105s] tests/test_print_tokens.py:49: AssertionError
[  105s] ==================== 1 failed, 101 passed in 29.52 seconds =====================
Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from prompt-toolkit/python-prompt-toolkit

All issues in prompt-toolkit/python-prompt-toolkit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.