Skip to content

fix compatibility for pytest 8 #20575

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 1 commit into from
Feb 26, 2025
Merged

Conversation

haifeng-jin
Copy link
Contributor

@haifeng-jin haifeng-jin commented Feb 5, 2025

What does this PR do?

The test test_seed_stays_same_with_multiple_seed_everything_calls is only compatible with pytest==7, but not pytest==8 due to its passing None to pytest.warns(), which is deprecated.

This PR fixes the test by making it compatible with both pytest 7 & 8.

more context:
We (Google) uses a monorepo that enforces the pytest version to be 8 for now.
We want to be able to run the unit tests instead of just importing the code.
So, we would like to make this compatibility fix.

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

📚 Documentation preview 📚: https://pytorch-lightning--20575.org.readthedocs.build/en/20575/

@github-actions github-actions bot added the fabric lightning.fabric.Fabric label Feb 5, 2025
@mergify mergify bot added the ready PRs ready to be merged label Feb 18, 2025
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49%. Comparing base (ea59e40) to head (d55923d).
Report is 5 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (ea59e40) and HEAD (d55923d). Click for more details.

HEAD has 2265 uploads less than BASE
Flag BASE (ea59e40) HEAD (d55923d)
cpu 525 24
lightning_fabric 67 7
pytest 266 26
python3.9 132 6
lightning 394 19
python3.10 66 3
python3.11 132 6
python3.12.7 195 9
pytorch2.1 99 0
pytest-full 261 0
pytorch2.2.2 33 0
pytorch_lightning 66 0
pytorch2.3 33 0
pytorch2.4.1 31 0
pytorch2.5.1 65 0
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #20575     +/-   ##
=========================================
- Coverage      88%      49%    -39%     
=========================================
  Files         267      264      -3     
  Lines       23380    23324     -56     
=========================================
- Hits        20481    11382   -9099     
- Misses       2899    11942   +9043     

@haifeng-jin
Copy link
Contributor Author

Hi @Borda , is there a next-step for me to get this PR merged? Thanks!

@Borda Borda merged commit 7bd9279 into Lightning-AI:master Feb 26, 2025
40 checks passed
Borda pushed a commit that referenced this pull request Mar 12, 2025
Co-authored-by: Haifeng Jin <[email protected]>
(cherry picked from commit 7bd9279)
lexierule pushed a commit that referenced this pull request Mar 18, 2025
Co-authored-by: Haifeng Jin <[email protected]>
(cherry picked from commit 7bd9279)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fabric lightning.fabric.Fabric ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants