Skip to content

Conversation

@fumedev
Copy link

@fumedev fumedev bot commented Mar 24, 2024

CHANGED

  • Created a new test file testing/test_return_values.py in the testing directory of the pytest codebase. Added test cases to ensure that when a test function returns a value other than None, pytest raises a warning or fails the test.
  • Modified the existing check in test collection and execution logic by adding a new command-line option --strict-return-values which, when enabled, will activate the new behavior of failing the test if a non-None value is returned.
  • Added a new warning class ReturnTestWarning to src/_pytest/warnings.py to represent the specific warning raised when a test function returns a non-None value.
  • Updated the documentation in doc/en/warnings.rst to include the new warning class and detail the new command-line option, explaining its purpose and when to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant