Skip to content
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

test: show test package extras in pytest report header #2181

Merged
merged 1 commit into from
May 6, 2024

Conversation

mwtoews
Copy link
Contributor

@mwtoews mwtoews commented May 6, 2024

This minor enhancement will expand the pytest header to show which packages and versions from the "test" extra are installed. It should help in situations like #2180


New header would look something like this:

============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-8.2.0, pluggy-1.5.0 -- /opt/hostedtoolcache/Python/3.8.18/x64/bin/python
cachedir: .pytest_cache
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
required packages: numpy-1.24.4, matplotlib-3.7.5, pandas-2.0.3
optional packages: affine-2.4.0, descartes-1.1.0, fiona-1.9.6, geojson-3.1.0, geopandas-0.13.2, imageio-2.34.1, netcdf4-1.6.5, pymetis-2023.1.1, pyproj-3.5.0, pyshp-2.3.1, pyvista-0.43.7, rasterio-1.3.10, rasterstats-0.19.0, scipy-1.10.1, shapely-2.0.4, vtk-9.3.0, xmipy-1.4.0
test packages: flopy-3.7.0.dev0, coverage-7.5.1, flaky-3.8.1, filelock-3.14.0, jupyter-1.0.0, jupytext-1.2, modflow-devtools-1.4.0, pytest-8.2.0, pytest-benchmark-4.0.0, pytest-cov-5.0.0, pytest-dotenv-0.5.2, pytest-xdist-3.6.1, pyzmq-26.0.3, syrupy-4.6.1, virtualenv-20.26.1
rootdir: /home/runner/work/flopy/flopy/autotest
configfile: pytest.ini
plugins: anyio-4.3.0, syrupy-4.6.1, flaky-3.8.1, benchmark-4.0.0, dotenv-0.5.2, cov-5.0.0, xdist-3.6.1
created: 2/2 workers
2 workers [1342 items]

note that there is a bit of overlap between "test packages" and "plugins", e.g. "pytest-xdist-3.6.1" and "xdist-3.6.1". However, I'm not sure if packages and pytest plugins can be easily distinguished to reduce the repetition.

@mwtoews mwtoews force-pushed the impr-pytest-report-header branch from dc3c78c to ad759a1 Compare May 6, 2024 00:58
Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.0%. Comparing base (029a4e1) to head (ad759a1).
Report is 12 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #2181     +/-   ##
=========================================
+ Coverage     68.3%   71.0%   +2.7%     
=========================================
  Files          260     261      +1     
  Lines        57947   58078    +131     
=========================================
+ Hits         39611   41273   +1662     
+ Misses       18336   16805   -1531     

see 140 files with indirect coverage changes

@wpbonelli wpbonelli merged commit dc35b09 into modflowpy:develop May 6, 2024
24 checks passed
@mwtoews mwtoews deleted the impr-pytest-report-header branch May 6, 2024 01:47
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.

None yet

2 participants