@@ -19,17 +19,20 @@ def test_calls_each_hook(mocker):
19
19
hooks .run_hooks (hooks_list , env )
20
20
21
21
# Assert
22
- expected_calls = [
22
+ expected_info_calls = [
23
23
mocker .call ("Running 'script1'" ),
24
+ mocker .call ("Running 'script2'" ),
25
+ ]
26
+ mock_logger .info .assert_has_calls (expected_info_calls )
27
+ expected_debug_calls = [
24
28
mocker .call ("Exited with 0" ),
25
29
mocker .call ("output" ),
26
30
mocker .call ("error" ),
27
- mocker .call ("Running 'script2'" ),
28
31
mocker .call ("Exited with 0" ),
29
32
mocker .call ("output" ),
30
33
mocker .call ("error" ),
31
34
]
32
- mock_logger .debug .assert_has_calls (expected_calls )
35
+ mock_logger .debug .assert_has_calls (expected_debug_calls )
33
36
mock_run_command .assert_any_call ("script1" , env )
34
37
mock_run_command .assert_any_call ("script2" , env )
35
38
@@ -48,9 +51,9 @@ def test_raises_exception_if_hook_fails(mocker):
48
51
hooks .run_hooks (hooks_list , env )
49
52
50
53
# Assert
51
- expected_debug_calls = [mocker .call ("Running 'script1'" )]
54
+ expected_info_calls = [mocker .call ("Running 'script1'" )]
52
55
expected_warning_calls = [mocker .call ("output" ), mocker .call ("error" )]
53
- mock_logger .debug .assert_has_calls (expected_debug_calls )
56
+ mock_logger .info .assert_has_calls (expected_info_calls )
54
57
mock_logger .warning .assert_has_calls (expected_warning_calls )
55
58
mock_run_command .assert_any_call ("script1" , env )
56
59
@@ -68,5 +71,5 @@ def test_does_not_call_each_hook_when_dry_run(mocker):
68
71
69
72
# Assert
70
73
expected_calls = [mocker .call ("Would run 'script1'" ), mocker .call ("Would run 'script2'" )]
71
- mock_logger .debug .assert_has_calls (expected_calls )
74
+ mock_logger .info .assert_has_calls (expected_calls )
72
75
mock_run_command .assert_not_called ()
0 commit comments