File tree Expand file tree Collapse file tree
tests/core/engine_adapter/integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,17 +105,26 @@ def _create(
105105 gateway ,
106106 is_remote = is_remote ,
107107 )
108- ctx .init ()
109-
110- with ctx .engine_adapter .session ({}):
111- yield ctx
112108
109+ skip = False
113110 try :
114- ctx .cleanup ()
111+ ctx .init ()
115112 except Exception :
116- # We need to catch this exception because if there is an error during teardown , pytest-retry aborts immediately
113+ # We need to catch this exception because if there is an error during setup , pytest-retry aborts immediately
117114 # instead of retrying
118- logger .exception ("Context cleanup failed" )
115+ logger .exception ("Context init failed" )
116+ skip = True
117+
118+ if not skip :
119+ with ctx .engine_adapter .session ({}):
120+ yield ctx
121+
122+ try :
123+ ctx .cleanup ()
124+ except Exception :
125+ # We need to catch this exception because if there is an error during teardown, pytest-retry aborts immediately
126+ # instead of retrying
127+ logger .exception ("Context cleanup failed" )
119128
120129 return _create
121130
You can’t perform that action at this time.
0 commit comments