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

Remove dead (unused) fixtures #2219

Merged
merged 3 commits into from
Jun 22, 2023

Conversation

xansh
Copy link
Member

@xansh xansh commented Feb 25, 2023

📝 Description

Type: 🚦 testing

According to pytest dead fixtures, there are some fixtures which are not being used:

Fixture name: refdata, location: tardis/gui/tests/test_gui.py:14
Fixture name: verysimple_collection, location: tardis/montecarlo/montecarlo_numba/tests/conftest.py:28
Fixture name: runner, location: tardis/montecarlo/tests/conftest.py:8
Fixture name: expected_ff_emissivity, location: tardis/montecarlo/tests/test_montecarlo.py:100
Fixture name: ion_edges, location: tardis/montecarlo/tests/test_montecarlo.py:113
Fixture name: continuum_compare_data_fname, location: tardis/montecarlo/tests/test_montecarlo.py:82
Fixture name: continuum_compare_data, location: tardis/montecarlo/tests/test_montecarlo.py:88
Fixture name: data_path, location: tardis/montecarlo/tests/test_packet_source.py:12

To Reproduce

# Install pytest dead fixtures
pip install pytest-deadfixtures

# Look for dead fixtures in tardis
pytest --dead-fixtures

Fix
Removed the dead fixtures. The output of pytest --dead-fixtures after the changes is as follows:

Cool, every declared fixture is being used.

no tests ran in 4.29s

resolves Issue#1858

🚦 Testing

How did you test these changes?

  • pytest --dead-fixtures
  • Testing pipeline
  • Other method (describe)
  • My changes can't be tested (explain why)

☑️ Checklist

  • I requested two reviewers for this pull request
  • [] I updated the documentation according to my changes
  • [] I built the documentation by applying the build_docs label

Note: If you are not allowed to perform any of these actions, ping (@) a contributor.

@tardis-bot
Copy link
Contributor

*beep* *bop*

Hi, human.

I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently.

Please add your name and email to .mailmap in your current branch and push the changes to this pull request.

In case you need to map an existing alias, follow this example.

@atharva-2001
Copy link
Member

Did tests pass on your machine? (Assuming you did not skip tests that used reference data)

@xansh
Copy link
Member Author

xansh commented Feb 25, 2023

@atharva-2001 I ran the following tests on master branch and my branch:

  • pytest tardis (All passed/skipped: Exactly the same output as master branch)
  • pytest tardis --tardis-refdata=<path to tardis-refdata repo> (14 cases failed, but that's happening in master branch too. The output in my branch is exactly the same as master branch)
  • pytest -rs tardis/plasma/tests/test_complete_plasmas.py --tardis-refdata=<path to tardis-refdata repo> --generate-reference (All skipped, same output as master branch)

@xansh
Copy link
Member Author

xansh commented Feb 25, 2023

@atharva-2001 I think the test cases with pytest tardis --tardis-refdata=<path to tardis-refdata repo> failed because I was not putting proper path to ref-data and hence those test cases were not able to find the atom data.

Just to confirm, we need to clone the tardis-refdata repository and provide a path to that above?

I'll rerun and update the result here.

@xansh
Copy link
Member Author

xansh commented Feb 25, 2023

@atharva-2001 The changes passed all test cases locally!

1529 passed, 275 skipped, 17 xfailed, 8 xpassed, 657 warnings

@codecov
Copy link

codecov bot commented Feb 26, 2023

Codecov Report

Merging #2219 (432fab2) into master (b5738b3) will increase coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 432fab2 differs from pull request most recent head 22caa5d. Consider uploading reports for the commit 22caa5d to get more accurate results

@@            Coverage Diff             @@
##           master    #2219      +/-   ##
==========================================
+ Coverage   71.95%   71.96%   +0.01%     
==========================================
  Files         137      137              
  Lines       12517    12502      -15     
==========================================
- Hits         9006     8997       -9     
+ Misses       3511     3505       -6     
Impacted Files Coverage Δ
tardis/montecarlo/tests/test_packet_source.py 86.95% <ø> (+1.77%) ⬆️
...sualization/widgets/tests/test_custom_abundance.py 100.00% <ø> (+5.05%) ⬆️

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

@atharva-2001
Copy link
Member

@xansh Wonderful!

@atharva-2001
Copy link
Member

@xansh Would you mind rebasing this?

Copy link
Contributor

@andrewfullard andrewfullard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reinstate the continuum tests

@xansh xansh force-pushed the pytest-dead-fixtures-issue-1858 branch from 66a930d to 063f133 Compare June 21, 2023 17:13
@tardis-bot
Copy link
Contributor

*beep* *bop*

Hi, human.

I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently.

Please add your name and email to .mailmap in your current branch and push the changes to this pull request.

In case you need to map an existing alias, follow this example.

@xansh xansh self-assigned this Jun 21, 2023
@xansh xansh force-pushed the pytest-dead-fixtures-issue-1858 branch from 063f133 to 7273e6a Compare June 21, 2023 18:16
@xansh
Copy link
Member Author

xansh commented Jun 21, 2023

@andrewfullard @atharva-2001 @Rodot- I have reinstated the continuum tests.

@xansh
Copy link
Member Author

xansh commented Jun 21, 2023

@andrewfullard I have added back the missed continuum tests expected_ff_emissivity and ion_edges

@wkerzendorf wkerzendorf merged commit 0e8a589 into tardis-sn:master Jun 22, 2023
@xansh xansh deleted the pytest-dead-fixtures-issue-1858 branch June 22, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants