You can cause pytest to generate an error upon encountering a warning by using the --strict
command-line option or adding strict = True
to your pytest.ini
file. This option causes pytest to fail any test that generates a warning.
For example, you can run pytest with the --strict
option like this:
pytest --strict
Or you can add strict = True
to your pytest.ini
file:
[pytest]
strict = True
This method ensures that any test that produces a warning also fails, helping you identify potential issues in your code.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-07-03 16:19:00 +0000
Seen: 11 times
Last updated: Jul 03 '23
What is the issue with the unexpected outcome when calling an unusual function?
What does "Function not defined" mean when a function is converted to an arrow function?
What is the method of focusing on a specific ESLint error message in the scripts of my package.json?
What does the error message "1 timer(s) still in the queue" indicate in an Angular/Karma unit test?