diff --git a/tests/mini_toolbox/__init__.py b/tests/mini_toolbox/__init__.py index 97d6f57..3184e37 100644 --- a/tests/mini_toolbox/__init__.py +++ b/tests/mini_toolbox/__init__.py @@ -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.''') diff --git a/tests/test_mini_toolbox.py b/tests/test_mini_toolbox.py new file mode 100644 index 0000000..7074e07 --- /dev/null +++ b/tests/test_mini_toolbox.py @@ -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