Fix pytest 9.1 fixture-mark import failure#687
Merged
Merged
Conversation
why: Pytest 9.1 rejects marks applied to fixture functions during plugin import. Without this fix, libtmux's pytest plugin can fail before collection for downstream users. The mark never affected fixture behavior, and conftest.py already decides when to request zshrc. what: - Remove the skipif mark from the zshrc fixture - Keep the fixture and USING_ZSH request path intact for zsh users
why: Project-wide ignores for libtmux deprecations can hide plugin compatibility regressions until downstream users hit them. what: - Remove the filterwarnings entry that ignored libtmux deprecations
why: Test-suite deprecation warnings should stay visible so compatibility regressions are fixed where they are introduced instead of hidden by config. what: - Remove the filterwarnings entry that ignored test deprecations
why: The remaining pytest warning ignore is not needed by the current suite. Keeping warning filters in project config encourages hiding compatibility signals. what: - Remove the remaining frontend.OptionParser deprecation ignore - Drop the now-empty filterwarnings block from pytest configuration
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #687 +/- ##
==========================================
+ Coverage 51.29% 51.30% +0.01%
==========================================
Files 25 25
Lines 3488 3487 -1
Branches 686 686
==========================================
Hits 1789 1789
+ Misses 1404 1403 -1
Partials 295 295 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
why: Document the downstream-facing pytest 9.1 import fix for the forthcoming 0.59.x release so users of libtmux's pytest fixtures know the plugin loads on pytest 9.1+. what: - Add a Fixes entry under the 0.59.x unreleased block noting the pytest plugin now imports cleanly under pytest 9.1
tony
added a commit
to tmux-python/tmuxp
that referenced
this pull request
Jun 17, 2026
Raises the libtmux floor to ~=0.58.1 so tmuxp's pytest fixtures keep loading under pytest 9.1+. libtmux's bundled pytest plugin applied a mark to its zshrc fixture that pytest 9.1 rejects during plugin import — before collection — which broke test runs for any project that loads the plugin to use tmuxp's or libtmux's fixtures. libtmux 0.58.1 fixes the mark; this floor bump pulls in that fix. - **Dependency floor:** libtmux ~=0.58.0 -> ~=0.58.1, resolved from PyPI. - **Dev toolchain:** bump the locked dev tooling, moving tmuxp's own test runs onto pytest 9.1.0 — the version the fix is required for. - **Changelog:** record the floor bump and the pytest 9.1 fixture compatibility fix under the unreleased notes. libtmux fix: tmux-python/libtmux#687
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #686.
This PR keeps libtmux's
zshrcfixture, but removes the pytest mark that was applied directly to the fixture function. Pytest 9.1 rejects that pattern during plugin import, before collection reaches any tests.It also removes the project-level pytest
filterwarningsblock one entry at a time so pytest-facing compatibility warnings stay visible in development and CI instead of being hidden by configuration.Upstream pytest context
Pytest documents marks on fixtures as deprecated in 7.4 and removed in 9.0:
In pytest 9.1, mark application now checks whether the target is a fixture and fails during decorator evaluation:
Reversing decorator order is not a compatible workaround, because fixture creation also rejects functions that already carry pytest marks:
Testing
uv run python -c 'import libtmux.pytest_plugin'uv run ruff check .uv run mypyTMUX= TMUX_PANE= SHELL=/bin/sh uv run pytest -q -W error::pytest.PytestWarning1258 passed, 2 skipped