Skip to content

Commit

Permalink
docs: Improve pytest_plugin.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Feb 2, 2025
1 parent bbef682 commit 5d4737a
Showing 1 changed file with 17 additions and 3 deletions.
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 @@ -66,7 +78,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 @@ -84,7 +97,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 comments on commit 5d4737a

Please sign in to comment.