@@ -358,6 +358,40 @@ async def test_maintenance_branch_pr_status_not_posted_on_main(action):
358
358
assert len (gh .post_ ) == 0
359
359
360
360
361
+ @pytest .mark .parametrize ('action' , ['opened' , 'reopened' , 'edited' , 'synchronize' ])
362
+ async def test_not_maintenance_branch_pr_status_not_posted_alt_base (action ):
363
+ """
364
+ When a PR is proposed against a non-maintenance branch, such
365
+ as another PR, it pass without status (same as with main). See
366
+ #381 for a detailed justification.
367
+ """
368
+ title = 'Fix some typo'
369
+ data = {
370
+ 'action' : action ,
371
+ 'number' : 2248 ,
372
+ 'pull_request' : {
373
+ 'title' : title ,
374
+ 'body' : '' ,
375
+ 'issue_url' : 'https://api.github.com/issue/2248' ,
376
+ 'base' : {
377
+ 'ref' : 'gh-1234/dependent-change' ,
378
+ },
379
+ 'statuses_url' : 'https://api.github.com/repos/python/cpython/statuses/somehash' ,
380
+ },
381
+ 'repository' : {'issues_url' : 'https://api.github.com/issue{/number}' },
382
+ 'changes' : {'title' : title },
383
+ }
384
+ event = sansio .Event (data , event = 'pull_request' , delivery_id = '1' )
385
+ getitem = {
386
+ 'https://api.github.com/issue/1234' :
387
+ {'labels' : [{'name' : 'CLA signed' }]},
388
+ 'https://api.github.com/issue/2248' : {},
389
+ }
390
+ gh = FakeGH (getitem = getitem )
391
+ await backport .router .dispatch (event , gh )
392
+ assert not gh .post_
393
+
394
+
361
395
@pytest .mark .parametrize ('ref' , ['3.9' , '4.0' , '3.10' ])
362
396
async def test_maintenance_branch_created (ref ):
363
397
event_data = {
0 commit comments