Skip to content

Commit 1d09f06

Browse files
committed
test: add @allow_on_cloud decorator to multiple epic tests in EpicTests
1 parent a054be3 commit 1d09f06

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/resources/test_epic.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from parameterized import parameterized
88

99
from jira.resources import Issue
10-
from tests.conftest import JiraTestCase, rndstr
10+
from tests.conftest import JiraTestCase, allow_on_cloud, rndstr
1111

1212

1313
class EpicTests(JiraTestCase):
@@ -33,24 +33,29 @@ def epic_field_name(self):
3333
def make_epic(self, **kwargs) -> Iterator[Issue]:
3434
try:
3535
# TODO: create_epic() method should exist!
36-
new_epic = self.jira.create_issue(
37-
fields={
36+
new_epic_fields = {
3837
"issuetype": {"name": "Epic"},
3938
"project": self.project_b,
40-
self.epic_field_name: self.epic_name,
4139
"summary": f"Epic summary for '{self.epic_name}'",
42-
},
40+
}
41+
if self.is_jira_cloud_ci:
42+
new_epic_fields[self.epic_field_name] = self.epic_name
43+
new_epic_fields.update(kwargs)
44+
new_epic = self.jira.create_issue(
45+
fields=new_epic_fields,
4346
)
4447
if len(kwargs):
4548
raise ValueError("Incorrect kwarg used !")
4649
yield new_epic
4750
finally:
4851
new_epic.delete()
4952

53+
@allow_on_cloud
5054
def test_epic_create_delete(self):
5155
with self.make_epic():
5256
pass
5357

58+
@allow_on_cloud
5459
@parameterized.expand(
5560
[("str", str), ("list", list)],
5661
)

0 commit comments

Comments
 (0)