mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-01-23 10:15:11 +00:00
Fix bug in OutputCapturer
This commit is contained in:
parent
679a77e336
commit
13857dde15
2 changed files with 12 additions and 1 deletions
|
|
@ -213,7 +213,6 @@ class OutputCapturer(object):
|
|||
# Not doing exception swallowing anywhere here.
|
||||
self._stderr_temp_setter.__exit__(exc_type, exc_value, exc_traceback)
|
||||
self._stdout_temp_setter.__exit__(exc_type, exc_value, exc_traceback)
|
||||
return self
|
||||
|
||||
output = property(lambda self: self.string_io.getvalue(),
|
||||
doc='''The string of output that was captured.''')
|
||||
|
|
|
|||
12
tests/test_mini_toolbox.py
Normal file
12
tests/test_mini_toolbox.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Copyright 2019 Ram Rachum and collaborators.
|
||||
# This program is distributed under the MIT license.
|
||||
|
||||
import pytest
|
||||
|
||||
from . import mini_toolbox
|
||||
|
||||
|
||||
def test_output_capturer_doesnt_swallow_exceptions():
|
||||
with pytest.raises(ZeroDivisionError):
|
||||
with mini_toolbox.OutputCapturer():
|
||||
1 / 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue