-
Notifications
You must be signed in to change notification settings - Fork 311
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
Fix incorrect type cast in vterm (apply_mapping
should return bytes
)
#545
Conversation
7e1ea53
to
34a2e06
Compare
@@ -227,17 +227,17 @@ def set_state(self, state: bool | Literal['mixed'], do_callback: bool = True) -> | |||
do_callback -- False to suppress signal from this change | |||
|
|||
>>> changes = [] | |||
>>> def callback_a(cb, state, user_data): | |||
>>> def callback_a(user_data, cb, state): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wardi looks like incorrect resolve order in Signals.emit
: cb
is part of *args
-> put after user_args
and before deprecated user_arg
.
@@ -49,6 +49,12 @@ universal = 0 | |||
profile = "black" | |||
line_length = 120 | |||
|
|||
[tool.pytest.ini_options] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now preparation only: warnings collected much better, but non-stable event loop tests and fully incompatible test_vterm
@@ -801,12 +801,13 @@ def render(self, size: tuple[int], focus: bool = False): | |||
return canv | |||
|
|||
|
|||
class SolidFill(BoxWidget): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
many years deprecated base class
if self._sgr_mapping or self._g[self.active] == 'ibmpc': | ||
dec_pos = DEC_SPECIAL_CHARS.find(char.decode('cp437')) | ||
if dec_pos >= 0: | ||
self.current = '0' | ||
return str(ALT_DEC_SPECIAL_CHARS[dec_pos]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incorrect cast, will cause BytesWarning
@@ -226,6 +240,7 @@ def test_erase_display(self): | |||
self.expect(' x5a98765') | |||
|
|||
def test_scrolling_region_simple(self): | |||
# TODO(Aleksei): Issue #544 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 tests which fail on regular basis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can mark them as flaky or to be skipped so they don't fail unrelated changes, can't we?
Add `time.sleep(0.1)` to the event loop tests: in the worst scenario on windows and slow machine function in parallel thread/async can wait up to 80 milliseconds (tested) Add type annotations to the `vterm` and `test_vterm` to simplify error lookup. * Fix `DeprecationWarning` in doctests & examples * Add `pytest` configuration in `pyproject.toml` without migration * `Signals.emit()` rework: stop `user_args` join with `weak_args` Partial: urwid#544 Partial: urwid#512 Partial: urwid#406
34a2e06
to
5909a22
Compare
``command`` is the command to execute inside the terminal, | ||
provided as a list of the command followed by its arguments. | ||
If 'command' is None, the command is the current user's shell. | ||
You can also provide a callable instead of a command, which will be executed in the subprocess. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like you almost aligned this paragraph to a new line width
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed split to increase readability: misread caused incomplete type annotation
* set timer for errors raise to 0: faster raise, faster test done
Add
time.sleep(0.1)
to the event loop tests:in the worst scenario on windows and slow machine
function in parallel thread/async can wait up to 80 milliseconds (tested)
Add type annotations to the
vterm
andtest_vterm
to simplify error lookup.Partial: #544
Partial: #512
Partial: #406
Checklist
master
orpython-dual-support
branchtox
successfully in local environment