Skip to content

Commit

Permalink
Refactor the pr_prefix into pytest fixture (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariatta authored Jun 30, 2022
1 parent a20390b commit 6aebdb4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_backport.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ async def post(self, url, url_vars={}, *, data):
self.post_.append((post_url, data))


@pytest.fixture(params=['gh', 'GH'])
def pr_prefix(request):
return request.param


async def test_edit_not_title():
data = {
'action': 'edited',
Expand Down Expand Up @@ -106,7 +111,6 @@ async def test_missing_backport_label():
assert gh.delete_url is None


@pytest.mark.parametrize('pr_prefix', ['GH', 'gh'])
async def test_backport_label_removal_success(pr_prefix):
event_data = {
'action': 'opened',
Expand Down Expand Up @@ -150,7 +154,6 @@ async def test_backport_label_removal_success(pr_prefix):
assert expected_post is not None


@pytest.mark.parametrize('pr_prefix', ['GH', 'gh'])
async def test_backport_label_removal_with_leading_space_in_title(pr_prefix):
event_data = {
'action': 'opened',
Expand Down Expand Up @@ -185,7 +188,6 @@ async def test_backport_label_removal_with_leading_space_in_title(pr_prefix):
{'name': 'needs backport to 3.6'})


@pytest.mark.parametrize('pr_prefix', ['GH', 'gh'])
async def test_backport_label_removal_with_parentheses_in_title(pr_prefix):
event_data = {
'action': 'opened',
Expand Down Expand Up @@ -220,7 +222,6 @@ async def test_backport_label_removal_with_parentheses_in_title(pr_prefix):
{'name': 'needs backport to 3.6'})


@pytest.mark.parametrize('pr_prefix', ['GH', 'gh'])
async def test_label_copying(pr_prefix):
event_data = {
'action': 'opened',
Expand Down

0 comments on commit 6aebdb4

Please sign in to comment.