Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1476875

Browse filesBrowse files
committed
fix(test): Fix doctest examples in random.py
why: The doctest examples were using line continuation with backslash followed by ellipsis which caused syntax errors during doctest execution. what: Replace multiline examples with simpler single-line assertions and use intermediate variables to make the examples more readable
1 parent a1ee582 commit 1476875
Copy full SHA for 1476875

File tree

Expand file treeCollapse file tree

2 files changed

+7
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-6
lines changed

‎src/libtmux/test/random.py

Copy file name to clipboardExpand all lines: src/libtmux/test/random.py
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ def get_test_session_name(server: Server, prefix: str = TEST_SESSION_PREFIX) ->
7979
'libtmux_...'
8080
8181
Never the same twice:
82-
>>> get_test_session_name(server=server) != \
83-
... get_test_session_name(server=server) # pragma: no cover
82+
>>> name1 = get_test_session_name(server=server) # pragma: no cover
83+
>>> name2 = get_test_session_name(server=server) # pragma: no cover
84+
>>> name1 != name2 # pragma: no cover
8485
True
8586
"""
8687
while True:
@@ -118,9 +119,9 @@ def get_test_window_name(
118119
'libtmux_...'
119120
120121
Never the same twice:
121-
122-
>>> get_test_window_name(session=session) != \
123-
... get_test_window_name(session=session) # pragma: no cover
122+
>>> name1 = get_test_window_name(session=session) # pragma: no cover
123+
>>> name2 = get_test_window_name(session=session) # pragma: no cover
124+
>>> name1 != name2 # pragma: no cover
124125
True
125126
"""
126127
assert prefix is not None

‎tests/test/test_environment.py

Copy file name to clipboardExpand all lines: tests/test/test_environment.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def test_environment_var_guard_exit_with_exception() -> None:
121121

122122
# Call __exit__ with exception parameters
123123
env.__exit__(
124-
t.cast(type[BaseException], RuntimeError),
124+
t.cast("type[BaseException]", RuntimeError),
125125
RuntimeError("Test exception"),
126126
None,
127127
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.