@@ -182,15 +182,19 @@ def test_falls_back_to_base_ref_when_merge_ref_is_unavailable(self):
182182 def test_exception_returns_empty (self ):
183183 with (
184184 patch .dict (os .environ , {"GITHUB_EVENT_NAME" : "pull_request" }),
185- patch ("main.get_messages_from_merge_ref" , side_effect = Exception ("git failed" )),
185+ patch (
186+ "main.get_messages_from_merge_ref" , side_effect = Exception ("git failed" )
187+ ),
186188 ):
187189 result = main .get_pr_commit_messages ()
188190 self .assertEqual (result , [])
189191
190192
191193class TestGitMessageReaders (unittest .TestCase ):
192194 def test_get_messages_from_merge_ref (self ):
193- mock_result = MagicMock (returncode = 0 , stdout = "fix: first\n \x00 feat: second\n \x00 " )
195+ mock_result = MagicMock (
196+ returncode = 0 , stdout = "fix: first\n \x00 feat: second\n \x00 "
197+ )
194198 with patch ("main.subprocess.run" , return_value = mock_result ) as mock_run :
195199 result = main .get_messages_from_merge_ref ()
196200 self .assertEqual (result , ["fix: first" , "feat: second" ])
@@ -417,7 +421,9 @@ def test_same_repo_not_fork(self):
417421 "base" : {"repo" : {"full_name" : "owner/repo" }},
418422 }
419423 }
420- with tempfile .NamedTemporaryFile (mode = "w" , suffix = ".json" , delete = False ) as file_obj :
424+ with tempfile .NamedTemporaryFile (
425+ mode = "w" , suffix = ".json" , delete = False
426+ ) as file_obj :
421427 json .dump (event , file_obj )
422428 event_path = file_obj .name
423429 with patch .dict (os .environ , {"GITHUB_EVENT_PATH" : event_path }):
@@ -434,7 +440,9 @@ def test_different_repo_is_fork(self):
434440 "base" : {"repo" : {"full_name" : "owner/repo" }},
435441 }
436442 }
437- with tempfile .NamedTemporaryFile (mode = "w" , suffix = ".json" , delete = False ) as file_obj :
443+ with tempfile .NamedTemporaryFile (
444+ mode = "w" , suffix = ".json" , delete = False
445+ ) as file_obj :
438446 json .dump (event , file_obj )
439447 event_path = file_obj .name
440448 with patch .dict (os .environ , {"GITHUB_EVENT_PATH" : event_path }):
0 commit comments