Repository navigation
Remove unused pytest fixtures - #3840
parthdembla007 wants to merge 2 commits into
Conversation
Remove fixtures reported by pytest-deadfixtures that no test uses, including test_gamma_ray_transport.py, which contained only unused fixtures and imports. Add .mailmap entry. Closes tardis-sn#1858 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
*beep* *bop* Hi, human. I'm the @tardis-bot and I noticed that your email is not associated with an ORCID ID in our database. Please add your email and ORCID ID to the If you don't have an ORCID ID yet, you can create one for free at orcid.org. ORCID IDs help ensure you get proper credit for your scientific contributions. The format should be: Runs: ORCID check · comment publisher |
|
👋 Welcome @parthdembla007! Thank you for your first contribution to this repository! A reviewer will take a look at your pull request soon. Please mark the pull request as draft if you are not ready for review yet or if there are things you will be adding. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3840 +/- ##
==========================================
+ Coverage 71.35% 71.37% +0.02%
==========================================
Files 207 207
Lines 15983 16007 +24
==========================================
+ Hits 11404 11425 +21
- Misses 4579 4582 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the contribution - the team looked at this and we're going to go through this ourselves to make sure we don't accidentally delete anything we need. I've changed the label on the issue to internal-dev only. |
What does this PR do?
Removes pytest fixtures that no test uses, addressing #1858.
The fixture list in #1858 is from 2022, and all of those fixtures have since been removed or renamed. I reran
pytest-deadfixtureson currentmasterwith regression data enabled (pytest --dead-fixtures tardis --tardis-regression-data=...). This PR removes the unused fixtures that haven't been touched recently.Changes
tardis/energy_input/tests/test_gamma_ray_transport.py(whole file)energy_input/testsgamma_ray_config→gamma_ray_simulation_state→gamma_ray_model_state) that nothing uses, plus 7 unused imports (ruff F401). It was last changed in #2552 (April 2024).he_test_config_yaml,he_test_config_csvyworkflows/high_energy/tests/conftest.pyhe_test_config_csvyalso points totardis_he_test_config_csvy.yml, which doesn't exist indata/.simple_isotope_abundancemodel/tests/test_base.pyIsotopicMassFractionimport, which nothing else uses.artis_abundances_fnameio/model/readers/tests/test_model_reader.pytardis/tests/test_util.pyis used and stays.vpacket_collectiontransport/montecarlo/tests/conftest.pyconfigplasma/radiation_field/tests/test_dilute_planckian_rad_field.pysimulation_statebuilds its ownConfiguration.No library code changed; only test code.
Left in place (please advise)
pytest-deadfixturesalso reports these, but they were added this year, so they may be meant for upcoming tests. I left them alone:hydrogen_atomic_data_fname:plasma/equilibrium/tests/conftest.py(Equilibrium plasma solver #3702)t_rad_calculatedanddilute_planckian_radiation_field(used only byt_rad_calculated):plasma/properties/tests/conftest.py(Unit Tests for Basic Properties #3606)I can remove them in this PR if you'd like.
Testing
Run in a
tardisenv created fromconda-linux-64.lock, withtardisbaseinstalled:pytest tardis/model/tests/test_base.py tardis/workflows/high_energy/tests tardis/io/model/readers/tests/test_model_reader.py tardis/plasma/radiation_field/tests tardis/transport/montecarlo/tests tardis/energy_input/tests --tardis-regression-data=...gives the same results on this branch as onmaster: 297 passed, 11 skipped, 5 xfailed, and 32 failed on both. The 32 failures are also onmaster: they are load errors (OSError/UnpicklingError) because I fetched only part of the LFS regression data locally.pytest --dead-fixtures tardis --tardis-regression-data=...now reports only the three fixtures listed above.ruff check --select Fandruff format --checkare clean on the changed files. The 7 F401 errors from the deleted module are gone.I haven't run the full test suite.
I also added myself to
.mailmapso the mailmap check passes.AI disclosure
This PR was prepared with help from Claude Code (finding dead fixtures, editing, running checks). I reviewed the changes.
Closes #1858