@@ -71,6 +71,9 @@ def create_test_run(request) -> typing.Generator[typing.Tuple[sv_run.Run, dict],
7171
7272@pytest .fixture
7373def create_test_run_offline (mocker : pytest_mock .MockerFixture , request , monkeypatch : pytest .MonkeyPatch ) -> typing .Generator [typing .Tuple [sv_run .Run , dict ], None , None ]:
74+ def testing_exit (status : int ) -> None :
75+ raise SystemExit (status )
76+ mocker .patch ("os._exit" , testing_exit )
7477 with tempfile .TemporaryDirectory () as temp_d :
7578 monkeypatch .setenv ("SIMVUE_OFFLINE_DIRECTORY" , temp_d )
7679 with sv_run .Run ("offline" ) as run :
@@ -79,7 +82,10 @@ def create_test_run_offline(mocker: pytest_mock.MockerFixture, request, monkeypa
7982
8083
8184@pytest .fixture
82- def create_plain_run (request ) -> typing .Generator [typing .Tuple [sv_run .Run , dict ], None , None ]:
85+ def create_plain_run (request , mocker : pytest_mock .MockFixture ) -> typing .Generator [typing .Tuple [sv_run .Run , dict ], None , None ]:
86+ def testing_exit (status : int ) -> None :
87+ raise SystemExit (status )
88+ mocker .patch ("os._exit" , testing_exit )
8389 with sv_run .Run () as run :
8490 yield run , setup_test_run (run , False , request )
8591 clear_out_files ()
@@ -102,7 +108,10 @@ def create_plain_run_offline(mocker: pytest_mock.MockerFixture, request, monkeyp
102108
103109
104110@pytest .fixture
105- def create_run_object () -> sv_api_obj .Run :
111+ def create_run_object (mocker : pytest_mock .MockFixture ) -> sv_api_obj .Run :
112+ def testing_exit (status : int ) -> None :
113+ raise SystemExit (status )
114+ mocker .patch ("os._exit" , testing_exit )
106115 _fix_use_id : str = str (uuid .uuid4 ()).split ('-' , 1 )[0 ]
107116 _folder = sv_api_obj .Folder .new (path = f"/simvue_unit_testing/{ _fix_use_id } " )
108117 _folder .commit ()
0 commit comments