Skip to content

pytest plugin #411

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

Merged
merged 11 commits into from
Sep 10, 2022
Merged

pytest plugin #411

merged 11 commits into from
Sep 10, 2022

Conversation

tony
Copy link
Member

@tony tony commented Sep 10, 2022

Fixes #381

  • We have a pytest plugins
  • The plugin itself is 100% (no autouse fixtures), we moved those to conftest.py in our own packages (docs/, libtmux/,tests/)
  • Doc page for pytest plugin

@codecov
Copy link

codecov bot commented Sep 10, 2022

Codecov Report

Merging #411 (118d2f4) into master (35e6dfa) will decrease coverage by 2.93%.
The diff coverage is 80.21%.

❗ Current head 118d2f4 differs from pull request most recent head 87b13bf. Consider uploading reports for the commit 87b13bf to get more accurate results

@@            Coverage Diff             @@
##           master     #411      +/-   ##
==========================================
- Coverage   88.67%   85.73%   -2.94%     
==========================================
  Files          18       21       +3     
  Lines        1854     1809      -45     
  Branches        0      276     +276     
==========================================
- Hits         1644     1551      -93     
+ Misses        210      177      -33     
- Partials        0       81      +81     
Impacted Files Coverage Δ
libtmux/pane.py 73.86% <ø> (-4.40%) ⬇️
libtmux/server.py 72.13% <ø> (-8.75%) ⬇️
libtmux/window.py 75.86% <ø> (-9.03%) ⬇️
libtmux/pytest_plugin.py 79.48% <79.48%> (ø)
libtmux/conftest.py 84.00% <81.81%> (-6.48%) ⬇️
docs/conftest.py 100.00% <100.00%> (ø)
tests/conftest.py 100.00% <100.00%> (ø)
libtmux/session.py 74.30% <0.00%> (-8.75%) ⬇️
... and 10 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Moving from conftest.py to pytest_plugin.py (which comes via a
setuptools entry point) requires a workaround to prevent loss
of coverage from real libtmux tests relying on our pytest plugin.

See also:
- https://pytest-cov.readthedocs.io/en/latest/plugins.html
- pytest-dev/pytest#935 (comment)
@tony tony force-pushed the pytest-module branch 2 times, most recently from f25e5d3 to 48a9865 Compare September 10, 2022 11:54
This makes the docs look more realistic, but we need to make it work
across tmux versions and python versions put into the CI matrix.
@tony tony force-pushed the pytest-module branch 2 times, most recently from 1d55e88 to 7d46b0e Compare September 10, 2022 12:29
@tony tony force-pushed the pytest-module branch 4 times, most recently from da8dede to 27a956a Compare September 10, 2022 13:30
This prevents plugins from being invoked simply by having libtmux
installed. We don't want that - it would interrupt systems. Explicit is
better than implicit.

Move autouse for libtmux itself to the appropriate places.
@tony tony merged commit b34ed38 into master Sep 10, 2022
@tony tony deleted the pytest-module branch September 10, 2022 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create libtmux.testing module as a pytest plugin
1 participant