Skip to content

Commit 0141f6a

Browse files
committed
check err not out
1 parent 43f151f commit 0141f6a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/integration/test_exception_handlers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def driver(test_app: AppHarness) -> Generator[WebDriver, None, None]:
114114

115115
def test_frontend_exception_handler_during_runtime(
116116
driver: WebDriver,
117-
capsys,
117+
capsys: pytest.CaptureFixture[str],
118118
):
119119
"""Test calling frontend exception handler during runtime.
120120
@@ -136,13 +136,13 @@ def test_frontend_exception_handler_during_runtime(
136136
time.sleep(2)
137137

138138
captured_default_handler_output = capsys.readouterr()
139-
assert "induce_frontend_error" in captured_default_handler_output.out
140-
assert "ReferenceError" in captured_default_handler_output.out
139+
assert "induce_frontend_error" in captured_default_handler_output.err
140+
assert "ReferenceError" in captured_default_handler_output.err
141141

142142

143143
def test_backend_exception_handler_during_runtime(
144144
driver: WebDriver,
145-
capsys,
145+
capsys: pytest.CaptureFixture[str],
146146
):
147147
"""Test calling backend exception handler during runtime.
148148
@@ -164,14 +164,14 @@ def test_backend_exception_handler_during_runtime(
164164
time.sleep(2)
165165

166166
captured_default_handler_output = capsys.readouterr()
167-
assert "divide_by_number" in captured_default_handler_output.out
168-
assert "ZeroDivisionError" in captured_default_handler_output.out
167+
assert "divide_by_number" in captured_default_handler_output.err
168+
assert "ZeroDivisionError" in captured_default_handler_output.err
169169

170170

171171
def test_frontend_exception_handler_with_react(
172172
test_app: AppHarness,
173173
driver: WebDriver,
174-
capsys,
174+
capsys: pytest.CaptureFixture[str],
175175
):
176176
"""Test calling frontend exception handler during runtime.
177177
@@ -194,9 +194,9 @@ def test_frontend_exception_handler_with_react(
194194

195195
captured_default_handler_output = capsys.readouterr()
196196
if isinstance(test_app, AppHarnessProd):
197-
assert "Error: Minified React error #31" in captured_default_handler_output.out
197+
assert "Error: Minified React error #31" in captured_default_handler_output.err
198198
else:
199199
assert (
200200
"Error: Objects are not valid as a React child (found: object with keys \n{invalid})"
201-
in captured_default_handler_output.out
201+
in captured_default_handler_output.err
202202
)

0 commit comments

Comments
 (0)