@@ -71,6 +71,9 @@ def create_test_run(request) -> typing.Generator[typing.Tuple[sv_run.Run, dict],
71
71
72
72
@pytest .fixture
73
73
def 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 )
74
77
with tempfile .TemporaryDirectory () as temp_d :
75
78
monkeypatch .setenv ("SIMVUE_OFFLINE_DIRECTORY" , temp_d )
76
79
with sv_run .Run ("offline" ) as run :
@@ -79,7 +82,10 @@ def create_test_run_offline(mocker: pytest_mock.MockerFixture, request, monkeypa
79
82
80
83
81
84
@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 )
83
89
with sv_run .Run () as run :
84
90
yield run , setup_test_run (run , False , request )
85
91
clear_out_files ()
@@ -102,7 +108,10 @@ def create_plain_run_offline(mocker: pytest_mock.MockerFixture, request, monkeyp
102
108
103
109
104
110
@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 )
106
115
_fix_use_id : str = str (uuid .uuid4 ()).split ('-' , 1 )[0 ]
107
116
_folder = sv_api_obj .Folder .new (path = f"/simvue_unit_testing/{ _fix_use_id } " )
108
117
_folder .commit ()
0 commit comments