@@ -114,7 +114,7 @@ def driver(test_app: AppHarness) -> Generator[WebDriver, None, None]:
114114
115115def 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
143143def 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
171171def 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