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

Ensure all the exceptions can be spied on #216

Merged

Commits on Dec 11, 2020

  1. Ensure all the exceptions cat be spied on

    This change replaces `Exception` with `BaseException` in the `spy()`
    method provided by the `mocker` fixture. This enables the caller to
    spy on things like `KeyboardInterrupt`, `GeneratorExit` and
    `SystemExit` exceptions that hasn't been possible before because of
    a bug.
    
    Before this change, any occurances of the above exceptions caused
    `spy()` to assign `None` to both `spy_return` and `spy_exception`
    attributes.
    
    Fixes pytest-dev#215
    webknjaz committed Dec 11, 2020
    Copy the full SHA
    0e6b221 View commit details
    Browse the repository at this point in the history