Skip to content

Conversation

@fumedev
Copy link

@fumedev fumedev bot commented Mar 24, 2024

CHANGED

  • Added new validation checks to the raises function in src/_pytest/python_api.py to handle cases where expected_exception is () or None. If the input is invalid, a UsageError is now raised with a detailed error message.

CHANGED

  • Implemented new validation logic in the warns function in src/_pytest/recwarn.py to handle scenarios where expected_warning is () or None. If the input is invalid, a TypeError is now raised with a detailed error message.

CHANGED

  • Updated the xfail function in src/_pytest/mark/structures.py to include checks for raises being () or None when provided. In case of invalid input, a UsageError is now raised with a detailed error message.

These enhancements ensure that pytest.raises(), pytest.warns(), and pytest.mark.xfail() functions provide clearer and more informative error messages when encountering () or None as arguments.

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