Skip to content

Commit b709acd

Browse files
authored
Pytest(fix): Plugin imports cleanly under pytest 9.1 (#687)
libtmux's pytest plugin failed to import under pytest 9.1, which rejects marks applied to fixture functions during plugin import -- before test collection begins. Because the plugin ships as an installed entry point, this aborted the entire test session for any downstream project that has libtmux installed and upgrades to pytest 9.1+ (for example, tmuxp). This removes the offending no-op mark and stops the project from hiding pytest compatibility warnings in its own configuration. - **pytest 9.1 plugin import**: Remove the no-op `skipif` mark from the `zshrc` fixture. Marks on fixtures never had any effect; the real zsh gating lives in `conftest.py` and is unchanged, so behavior is identical for zsh and non-zsh users. - **Visible compatibility warnings**: Drop the project `filterwarnings` ignore block (libtmux deprecations, test deprecations, and the docutils `frontend.OptionParser` deprecation) so compatibility signals surface in development and CI instead of being hidden. - **Changelog**: Document the fix under the 0.59.x unreleased block. Fixes #686
2 parents 16a9137 + 9e278f1 commit b709acd

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

CHANGES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ $ uvx --from 'libtmux' --prerelease allow python
4545
_Notes on the upcoming release will go here._
4646
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->
4747

48+
### Fixes
49+
50+
#### pytest 9.1 compatibility for the pytest plugin (#687)
51+
52+
libtmux's pytest plugin (see {ref}`pytest_plugin`) now imports cleanly
53+
under pytest 9.1, which began rejecting marks applied to fixture
54+
functions. Projects that use libtmux's fixtures can upgrade to pytest
55+
9.1+ without the plugin aborting before test collection.
56+
4857
## libtmux 0.58.0 (2026-05-23)
4958

5059
libtmux 0.58.0 fixes subprocess output decoding on non-UTF-8 locales.

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,3 @@ testpaths = [
251251
markers = [
252252
"integration: sphinx integration tests (require full sphinx build)",
253253
]
254-
filterwarnings = [
255-
"ignore:The frontend.Option(Parser)? class.*:DeprecationWarning::",
256-
"ignore::DeprecationWarning:libtmux.*:",
257-
"ignore::DeprecationWarning:tests:", # tests/
258-
]

src/libtmux/pytest_plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ def user_path(home_path: pathlib.Path, home_user_name: str) -> pathlib.Path:
8282
return p
8383

8484

85-
@pytest.mark.skipif(USING_ZSH, reason="Using ZSH")
8685
@pytest.fixture(scope="session")
8786
def zshrc(user_path: pathlib.Path) -> pathlib.Path:
8887
"""Suppress ZSH default message.

0 commit comments

Comments
 (0)