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

disable warnings summary for pytest #9743

Merged
merged 3 commits into from
Sep 30, 2021
Merged

Conversation

awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Sep 29, 2021

What does this PR do?

There are literally thousands of lines of output from pytest informing us about warnings.

tests/checkpointing/test_model_checkpoint.py::test_model_checkpoint_score_and_ckpt_val_check_interval[0.42-False-False]
  /__w/pytorch-lightning/pytorch-lightning/pytorch_lightning/callbacks/model_checkpoint.py:622: UserWarning: Checkpoint directory /tmp/pytest-of-root/pytest-0/test_model_checkpoint_score_an8 exists and is not empty.
    rank_zero_warn(f"Checkpoint directory {dirpath} exists and is not empty.")

It's simply not practical.
This PR disables this nonsense of endless scrolling.

The statistic of how many warnings there are in total is still visible like so:
==== 44 passed, 7 skipped, 217 warnings in 5.33s ====

Before submitting

  • Was this discussed/approved 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 update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

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

  • 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

Did you have fun?

I made sure I had fun coding 🙃

@awaelchli awaelchli changed the title add option --disable-pytest-warnings in pytest configuration disable warnings summary for pytest Sep 29, 2021
@awaelchli awaelchli added productivity ci Continuous Integration labels Sep 29, 2021
@awaelchli awaelchli added this to the v1.5 milestone Sep 29, 2021
@awaelchli awaelchli marked this pull request as ready for review September 29, 2021 00:40
@github-actions
Copy link
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@codecov
Copy link

codecov bot commented Sep 29, 2021

Codecov Report

Merging #9743 (274ca23) into master (8c9cb0c) will decrease coverage by 4%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #9743    +/-   ##
=======================================
- Coverage      93%     89%    -4%     
=======================================
  Files         177     177            
  Lines       15456   15456            
=======================================
- Hits        14317   13698   -619     
- Misses       1139    1758   +619     

@ananthsub
Copy link
Contributor

There are literally thousands of lines of output from pytest informing us about warnings.

how much of the warnings would you estimate is due to overzealous warnings by the framework vs tests having real issues?
if we turn off warnings like this, would users turn off warnings too?

@awaelchli
Copy link
Contributor Author

@ananthsub I would say the majority is definitely from the framework. The majority of warnings are "friendly" messages for users who haven't fully configured and tuned the settings. But in our tests, messages like these do not matter. For example, since we use BoringModel in practically every test, it will always raise this warning:

The dataloader, train_dataloader, does not have many workers which may be a bottleneck. Consider increasing the value of the num_workers argument`

@mergify mergify bot added ready PRs ready to be merged has conflicts labels Sep 29, 2021
setup.cfg Show resolved Hide resolved
@mergify mergify bot removed the has conflicts label Sep 29, 2021
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGMT !

@awaelchli awaelchli merged commit b054d21 into master Sep 30, 2021
@awaelchli awaelchli deleted the ci/disable-warnings-summary branch September 30, 2021 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants