@@ -227,9 +227,10 @@ class TestCase:
227227 with self .subTest (msg = case .name ):
228228 self ._bw .repo .get_pulls .reset_mock ()
229229 self ._bw .repo .get_pulls .return_value = case .prs
230- with patch .object (BranchWorker , "add_pr" ) as ap , patch .object (
231- BranchWorker , "_is_relevant_pr"
232- ) as rp :
230+ with (
231+ patch .object (BranchWorker , "add_pr" ) as ap ,
232+ patch .object (BranchWorker , "_is_relevant_pr" ) as rp ,
233+ ):
233234 # set is_relevant return values
234235 rp .side_effect = [pr .relevant for pr in case .prs ]
235236
@@ -328,9 +329,10 @@ class R:
328329 lr .remote .assert_called_with (UPSTREAM_REMOTE_NAME )
329330
330331 def test_do_sync_reset_repo (self ) -> None :
331- with patch .object (self ._bw , "repo_local" ) as lr , patch (
332- "kernel_patches_daemon.branch_worker._reset_repo"
333- ) as rr :
332+ with (
333+ patch .object (self ._bw , "repo_local" ) as lr ,
334+ patch ("kernel_patches_daemon.branch_worker._reset_repo" ) as rr ,
335+ ):
334336 # Create a mock suitable to mock a git.RemoteReference
335337 remote_ref = "a/b/c/d"
336338 m = MagicMock ()
@@ -426,9 +428,10 @@ class TestCase:
426428 def test_fetch_repo_path_doesnt_exist_full_sync (self ) -> None :
427429 """When the repo does not exist yet, a full sync is performed."""
428430 fetch_params = ["somepath" , "giturl" , "branch" ]
429- with patch .object (self ._bw , "full_sync" ) as fr , patch (
430- "kernel_patches_daemon.branch_worker.os.path.exists"
431- ) as exists :
431+ with (
432+ patch .object (self ._bw , "full_sync" ) as fr ,
433+ patch ("kernel_patches_daemon.branch_worker.os.path.exists" ) as exists ,
434+ ):
432435 # path does not exists
433436 exists .return_value = False
434437 self ._bw .fetch_repo (* fetch_params )
@@ -437,9 +440,10 @@ def test_fetch_repo_path_doesnt_exist_full_sync(self) -> None:
437440 def test_fetch_repo_path_exists_no_full_sync (self ) -> None :
438441 """If the repo already exist, we don't perform a full sync."""
439442 fetch_params = ["somepath" , "giturl" , "branch" ]
440- with patch .object (self ._bw , "full_sync" ) as fr , patch (
441- "kernel_patches_daemon.branch_worker.os.path.exists"
442- ) as exists :
443+ with (
444+ patch .object (self ._bw , "full_sync" ) as fr ,
445+ patch ("kernel_patches_daemon.branch_worker.os.path.exists" ) as exists ,
446+ ):
443447 # path does exists
444448 exists .return_value = True
445449 self ._bw .fetch_repo (* fetch_params )
@@ -448,9 +452,10 @@ def test_fetch_repo_path_exists_no_full_sync(self) -> None:
448452 def test_fetch_repo_path_exists_git_exception (self ) -> None :
449453 """When the repo exists but we hit a git command exception, we fallback on full sync."""
450454 fetch_params = ["somepath" , "giturl" , "branch" ]
451- with patch .object (self ._bw , "full_sync" ) as fr , patch (
452- "kernel_patches_daemon.branch_worker.os.path.exists"
453- ) as exists :
455+ with (
456+ patch .object (self ._bw , "full_sync" ) as fr ,
457+ patch ("kernel_patches_daemon.branch_worker.os.path.exists" ) as exists ,
458+ ):
454459 # path does exists
455460 exists .return_value = True
456461 self ._git_repo_mock .init .return_value .git .fetch .side_effect = (
@@ -520,9 +525,11 @@ class TestCase:
520525 with self .subTest (msg = case .name ):
521526 self ._bw .branches = case .branches
522527 self ._bw .all_prs = {p : {} for p in case .all_prs }
523- with patch .object (self ._bw , "filter_closed_pr" ) as fcp , patch .object (
524- self ._bw , "delete_branch"
525- ) as db , freeze_time (not_expired_time ):
528+ with (
529+ patch .object (self ._bw , "filter_closed_pr" ) as fcp ,
530+ patch .object (self ._bw , "delete_branch" ) as db ,
531+ freeze_time (not_expired_time ),
532+ ):
526533 fcp .side_effect = case .fcp_return_prs
527534 self ._bw .expire_branches ()
528535 # check fcp and db are called with proper counts
0 commit comments