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

Add --fail-if-warning #195

Open
fornellas opened this issue Jun 26, 2020 · 2 comments
Open

Add --fail-if-warning #195

fornellas opened this issue Jun 26, 2020 · 2 comments
Labels
enhancement New feature or request Hacktoberfest help wanted Extra attention is needed

Comments

@fornellas
Copy link
Contributor

Let's add an option --fail-if-warning, which'll look over issued warnings during test execution and fail them if warning issued. This can probably be done easily by patching Python's warning method and checking if it was called.

I see 3 cases to check for warnings:

1 - When importing test modules.
2 - When running individual tests.
3 - On shutdown.

For 1 & 2, this should be easy, not sure about 3.

An important feature of this, is to allow include / exclude paths to accept / ignore warnings. Eg: if a warning came from a third party library, there's sometimes little one can do, and we should ignore it. If warning came from the code being tested, it should surface.

@fornellas fornellas added enhancement New feature or request help wanted Extra attention is needed labels Jun 26, 2020
@roman-rezinkin
Copy link

roman-rezinkin commented Oct 8, 2021

I would be interested in attempting to add this option. Could I be assigned?

@fornellas
Copy link
Contributor Author

I bet @deathowl will be happy to merge a PR.

@roman-rezinkin there are some open question in this issue

  • how to deal with (3).
  • define an interface to define a list of modules to ignore warnings.

Do you have ideas for those?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants