8000 Docs: Tested doc examples by tony · Pull Request #581 · tmux-python/libtmux · GitHub
[go: up one dir, main page]

Skip to content

Docs: Tested doc examples #581

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

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2d40e6c
docs(test-helpers) Update to existing modules
tony Feb 27, 2025
e8b5d7a
docs(test-helpers) Add retry page
tony Feb 27, 2025
76326f3
py(deps[dev]) Bump dev packages
tony Feb 27, 2025
1668b45
chore: Add `__init__.py` for tests/examples
tony Feb 27, 2025
fc3dec2
chore: Add `__init__.py` for tests/examples/test
tony Feb 26, 2025
a438f2d
chore: Add `__init__.py` for tests/examples/_internal/waiter
tony Feb 27, 2025
aa260f2
fix(retry): Improve retry_until_extended function with better error m…
tony Feb 26, 2025
10a37e5
feat(waiter): Enhance terminal content waiting utility with fluent AP…
tony Feb 26, 2025
0c74d33
test(waiter): Fix test cases and improve type safety
tony Feb 26, 2025
a10493a
docs(waiter): Add comprehensive documentation for terminal content wa…
tony Feb 26, 2025
6bdbb5c
pyproject(mypy[exceptions]): examples to ignore `no-untyped-def`
tony Feb 26, 2025
d436d75
test: add conftest.py to register example marker
tony Feb 26, 2025
17d2967
refactor(tests[waiter]): Add waiter test examples into individual files
tony Feb 26, 2025
50081b5
docs(CHANGES) Note `Waiter`
tony Feb 27, 2025
db47652
feat(waiter): Add terminal content waiting utility for testing (#582)
tony Feb 27, 2025
9661039
cursor(rules[git-commits]) Use component name first
tony Feb 28, 2025
677aa96
cursor(rules[git-commits]) Standardize further
tony Feb 28, 2025
60d1386
cursor(rules[dev-loop]) Use `--show-fixes` in `ruff check`
tony Feb 28, 2025
9695bdf
tests(test_waiter[capture_pane]): Add resiliency for CI test grid
tony Feb 28, 2025
cf08043
tests(test_waiter[exact_match]): Skip flaky exact match test on tmux …
tony Feb 28, 2025
7db6426
test(waiter): Replace assertions with warning-based checks in detaile…
tony Feb 28, 2025
463b9c3
pyproject(mypy[test.examples.pytest_plugin]): pytest examples to igno…
tony Feb 26, 2025
f768e53
docs: Improve window.py
tony Feb 1, 2025
9020e14
docs: Improve session.py
tony Feb 1, 2025
5a41553
docs: Improve server.py
tony Feb 1, 2025
ca20738
docs: Improve pane.py
tony Feb 1, 2025
1ccd708
docs: Improve neo.py
tony Feb 1, 2025
2c1182a
docs: Improve test.py
tony Feb 1, 2025
431985e
docs: Improve common.py
tony Feb 1, 2025
002df05
docs: Improve exc.py
tony Feb 1, 2025
355d0bf
docs: Improve pytest_plugin.py
tony Feb 1, 2025
238d6d2
docs: Improve conftest.py
tony Feb 1, 2025
626f024
docs/tests: Add `server` doctest examples
tony Feb 15, 2025
38182be
fix(Server): update Server.windows doctest to be environment-agnostic
tony Feb 26, 2025
73b4a2c
docs: Add new Topics
tony Feb 26, 2025
0add0be
docs(topics): Improve documentation with executable examples
tony Feb 26, 2025
2248328
docs(README): Enhance project README with comprehensive overview
tony Feb 26, 2025
2a2b6ff
docs,tests(pytest plugin) Examples
tony Feb 26, 2025
14c4b27
!squash docs topics
tony Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: Improve pytest_plugin.py
  • Loading branch information
tony committed Feb 28, 2025
commit 355d0bfe97f5855c997e6879bf529eb96164106c
20 changes: 17 additions & 3 deletions src/libtmux/pytest_plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
"""libtmux pytest plugin."""
"""Provide a pytest plugin that supplies libtmux testing fixtures.

This plugin integrates with pytest to offer session, window, and environment
fixtures tailored for tmux-based tests. It ensures stable test environments by
creating and tearing down temporary sessions and windows for each test as
needed.

Notes
-----
The existing doctests embedded within each fixture are preserved to maintain
clarity and verify core behaviors.

"""

from __future__ import annotations

Expand Down Expand Up @@ -68,7 +80,8 @@ def config_file(user_path: pathlib.Path) -> pathlib.Path:

- ``base-index -g 1``

These guarantee pane and windows targets can be reliably referenced and asserted.
These guarantee pane and windows targets can be reliably referenced
and asserted.

Note: You will need to set the home directory, see :ref:`set_home`.
"""
Expand All @@ -86,7 +99,8 @@ def config_file(user_path: pathlib.Path) -> pathlib.Path:
def clear_env(monkeypatch: pytest.MonkeyPatch) -> None:
"""Clear out any unnecessary environment variables that could interrupt tests.

tmux show-environment tests were being interrupted due to a lot of crazy env vars.
tmux show-environment tests were being interrupted due to a lot of
crazy env vars.
"""
for k in os.environ:
if not any(
Expand Down
0