GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix pytest 9.1 fixture-mark import failure by tony · Pull Request #687 · tmux-python/libtmux

Conversation

@tony

@tony tony commented Jun 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

Fixes #686.

This PR keeps libtmux's zshrc fixture, 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 filterwarnings block 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:

  • https://github.com/pytest-dev/pytest/blob/9.1.0/doc/en/deprecations.rst#L576-L582

In pytest 9.1, mark application now checks whether the target is a fixture and fails during decorator evaluation:

  • https://github.com/pytest-dev/pytest/blob/9.1.0/src/_pytest/mark/structures.py#L405-L418
  • https://github.com/pytest-dev/pytest/blob/9.1.0/src/_pytest/mark/structures.py#L482-L495

Reversing decorator order is not a compatible workaround, because fixture creation also rejects functions that already carry pytest marks:

  • https://github.com/pytest-dev/pytest/blob/9.1.0/src/_pytest/fixtures.py#L1363-L1367

Testing

  • uv run python -c 'import libtmux.pytest_plugin'
  • uv run ruff check .
  • uv run mypy
  • TMUX= TMUX_PANE= SHELL=/bin/sh uv run pytest -q -W error::pytest.PytestWarning
    • 1258 passed, 2 skipped

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tony added 4 commits June 16, 2026 17:47
@tony
Pytest(fix[zshrc]): Remove mark from zshrc fixture
fbe5483
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
@tony
Pytest(chore[warnings]): Stop ignoring libtmux deprecations
d596ac2
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
@tony
Pytest(chore[warnings]): Stop ignoring test deprecations
1ff2f84
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
@tony
Pytest(chore[warnings]): Remove warning ignore block
3a67f70
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

codecov Bot commented Jun 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.30%. Comparing base (025d1f2) to head (9e278f1).
⚠️ Report is 7 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tony
docs(CHANGES): pytest 9.1 pytest-plugin compatibility fix
9e278f1
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 tony mentioned this pull request Jun 16, 2026
Require libtmux 0.58.1 for the pytest 9.1 fix tmux-python/tmuxp#1052
Merged
@tony
tony merged commit b709acd into master Jun 16, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@tony
tony deleted the pytest-zsh-dep branch June 16, 2026 23:49
@tony
tony restored the pytest-zsh-dep branch June 16, 2026 23:50
@tony
tony deleted the pytest-zsh-dep branch June 17, 2026 00:19
tony added a commit to tmux-python/tmuxp that referenced this pull request Jun 17, 2026
@tony
py(deps[libtmux]) Require 0.58.1 for pytest 9.1 compat (#1052)
0f2a130
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Remove deprecated pytest mark on fixture for pytest 9.0 compatibility

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@tony
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.