Skip to content

Commit a667688

Browse files
authored
Assert that we can backport to the 3.10 branch. (#453)
Signed-off-by: Mariatta <[email protected]> * πŸπŸŒšπŸ€– Formatted using `black`.
1 parent 66700f9 commit a667688

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

β€Žtests/test_backport_pr.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from gidgethub import sansio
55

6+
import pytest
67
import redis
78
import kombu
89

@@ -98,7 +99,8 @@ async def test_merged_pr_no_backport_label():
9899
assert not hasattr(gh, "post_url")
99100

100101

101-
async def test_merged_pr_with_backport_label():
102+
@pytest.mark.parametrize("branch", ["3.10", "3.11", "4.0", "3.7"])
103+
async def test_merged_pr_with_backport_label(branch):
102104
data = {
103105
"action": "closed",
104106
"pull_request": {
@@ -120,14 +122,16 @@ async def test_merged_pr_with_backport_label():
120122
},
121123
"https://api.github.com/repos/python/cpython/issues/1/labels": [
122124
{"name": "CLA signed"},
123-
{"name": "needs backport to 3.7"},
125+
{"name": f"needs backport to {branch}"},
124126
],
125127
}
126128

127129
gh = FakeGH(getitem=getitem)
128130
with mock.patch("miss_islington.tasks.backport_task.delay"):
129131
await backport_pr.router.dispatch(event, gh)
130-
assert "I'm working now to backport this PR to: 3.7" in gh.post_data["body"]
132+
assert (
133+
f"I'm working now to backport this PR to: {branch}" in gh.post_data["body"]
134+
)
131135
assert gh.post_url == "/repos/python/cpython/issues/1/comments"
132136

133137

0 commit comments

Comments
Β (0)