File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
tests/functional/event_handler Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -655,16 +655,14 @@ def foo():
655
655
assert result ["body" ] == json .dumps (response , indent = 4 )
656
656
657
657
658
- def test_debug_print_event (monkeypatch ):
658
+ def test_debug_print_event (capsys ):
659
659
# GIVE debug is True
660
660
app = ApiGatewayResolver (debug = True )
661
- mocked_print = MagicMock ()
662
- monkeypatch .setattr (builtins , "print" , mocked_print )
663
661
664
662
# WHEN calling resolve
665
663
event = {"path" : "/foo" , "httpMethod" : "GET" }
666
664
app (event , None )
667
665
668
666
# THEN print the event
669
- # NOTE: other calls might have happened outside of this mock
670
- mocked_print . assert_any_call ( json .dumps ( event , indent = 4 ))
667
+ out , err = capsys . readouterr ()
668
+ assert json .loads ( out ) == event
You can’t perform that action at this time.
0 commit comments