@@ -33,7 +33,7 @@ def test_delete_lockfile(tmp_path):
3333 assert not fake_lock .exists ()
3434
3535
36- def test_log_debug_raises_error (mocker ):
36+ def test_log_critical_raises_error (mocker ):
3737 """TODO: this probably should never happen?"""
3838
3939 def _fn ():
@@ -46,9 +46,9 @@ def _fn():
4646 mocked_log = mocker .patch ('autosubmit.scripts.autosubmit.Log' )
4747 mocked_print = mocker .patch ('autosubmit.scripts.autosubmit.print' )
4848
49- mocked_log .debug .side_effect = BaseException ()
50-
51- exit_from_error (e )
49+ mocked_log .critical .side_effect = BaseException ()
50+ with pytest . raises ( BaseException ):
51+ exit_from_error (e )
5252
5353 assert mocked_print .called
5454
@@ -60,11 +60,11 @@ def _fn():
6060@pytest .mark .parametrize (
6161 'exception,debug_calls,critical_calls,delete_called' ,
6262 [
63- (ValueError , 1 , 1 , True ),
64- (BaseLockException , 1 , 0 , False ),
65- (AutosubmitCritical , 1 , 1 , True ),
66- (_TEST_EXCEPTION , 2 , 1 , True ),
67- (AutosubmitError , 1 , 1 , True )
63+ (ValueError , 0 , 2 , True ),
64+ (BaseLockException , 0 , 1 , False ),
65+ (AutosubmitCritical , 0 , 2 , True ),
66+ (_TEST_EXCEPTION , 1 , 2 , True ),
67+ (AutosubmitError , 0 , 2 , True )
6868 ],
6969 ids = [
7070 'normal_exception' ,
0 commit comments