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

[FIX] Mock's patch contextmanager now requires exc_info like arguments #205

Merged

Conversation

StefanRijnhart
Copy link
Contributor

Fixes

  File "/home/user/mr.developer/.tox/py38/lib/python3.8/site-packages/mock/mock.py", line 1545, in __exit__
    return exit_stack.__exit__(*exc_info)
  File "/usr/lib/python3.8/contextlib.py", line 483, in __exit__
    received_exc = exc_details[0] is not None
IndexError: tuple index out of rang

when running tests

Fixes

```
  File "/home/user/mr.developer/.tox/py38/lib/python3.8/site-packages/mock/mock.py", line 1545, in __exit__
    return exit_stack.__exit__(*exc_info)
  File "/usr/lib/python3.8/contextlib.py", line 483, in __exit__
    received_exc = exc_details[0] is not None
IndexError: tuple index out of rang
```

when running tests
@fschulze
Copy link
Owner

Thanks!

@icemac
Copy link
Contributor

icemac commented Mar 17, 2021

Alternatively the actual API with .start() and .stop() could be used instead of .__enter__() and .__exit__().

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.

3 participants