Skip to content

Commit b8dd416

Browse files
authored
rename id to uid (fixes #43 via #44)
1 parent 0b9b453 commit b8dd416

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

allure-pytest/src/allure/listener.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def pytest_runtest_protocol(self, item, nextitem):
5454
group_uuid = self._cache.get(fixturedef)
5555
if not group_uuid:
5656
group_uuid = self._cache.set(fixturedef)
57-
group = TestResultContainer(id=group_uuid)
57+
group = TestResultContainer(uuid=group_uuid)
5858
self.allure_logger.start_group(group_uuid, group)
5959
self.allure_logger.update_group(group_uuid, children=uuid)
6060

61-
test_case = TestResult(name=item.name, id=uuid)
61+
test_case = TestResult(name=item.name, uuid=uuid)
6262
self.allure_logger.schedule_test(uuid, test_case)
6363

6464
yield
@@ -86,7 +86,7 @@ def pytest_fixture_setup(self, fixturedef, request):
8686

8787
if not container_uuid:
8888
container_uuid = self._cache.set(fixturedef)
89-
container = TestResultContainer(id=container_uuid)
89+
container = TestResultContainer(uuid=container_uuid)
9090
self.allure_logger.start_group(container_uuid, container)
9191

9292
self.allure_logger.update_group(container_uuid, start=now())

allure-pytest/src/allure/model2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _write(report_dir, item, glob):
2525

2626
@attrs
2727
class TestResultContainer(object):
28-
id = attrib(default=None)
28+
uuid = attrib(default=None)
2929
name = attrib(default=None)
3030
children = attrib(default=Factory(list))
3131
description = attrib(default=None)
@@ -57,7 +57,7 @@ class ExecutableItem(object):
5757

5858
@attrs
5959
class TestResult(ExecutableItem):
60-
id = attrib(default=None)
60+
uuid = attrib(default=None)
6161
fullName = attrib(default=None)
6262
labels = attrib(default=Factory(list))
6363
links = attrib(default=Factory(list))

allure-pytest/test/matchers/group.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def _matches(self, item):
1414
return has_property('test_containers',
1515
has_item(
1616
all_of(
17-
has_entry('children', has_item(item['id'])),
17+
has_entry('children', has_item(item['uuid'])),
1818
*self.matchers
1919
)
2020
)
@@ -33,11 +33,11 @@ def has_container(report, *matchers):
3333
... test_cases = [
3434
... {
3535
... 'fullName': 'test_case',
36-
... 'id': 'test_case_uuid'
36+
... 'uuid': 'test_case_uuid'
3737
... },
3838
... {
3939
... 'fullName': 'test_case_without_container',
40-
... 'id': 'test_case_without_container_uuid'
40+
... 'uuid': 'test_case_without_container_uuid'
4141
... }
4242
... ]
4343
... test_containers = [
@@ -82,7 +82,7 @@ def __init__(self, *args):
8282
def _test_case_id_by_name(report, test_case_name):
8383
for test_case in report.test_cases:
8484
if test_case['fullName'].endswith(test_case_name):
85-
return test_case['id']
85+
return test_case['uuid']
8686

8787
def _matches(self, report):
8888
return has_property('test_containers',
@@ -109,15 +109,15 @@ def has_same_container(*args):
109109
... test_cases = [
110110
... {
111111
... 'fullName': 'first_test_case',
112-
... 'id': 'first_test_case_uuid'
112+
... 'uuid': 'first_test_case_uuid'
113113
... },
114114
... {
115115
... 'fullName': 'second_test_case',
116-
... 'id': 'second_test_case_uuid'
116+
... 'uuid': 'second_test_case_uuid'
117117
... },
118118
... {
119119
... 'fullName': 'third_test_case',
120-
... 'id': 'third_test_case_uuid'
120+
... 'uuid': 'third_test_case_uuid'
121121
... }
122122
... ]
123123
... test_containers = [

allure-pytest/test/matchers/item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def has_attachment(attach_type=None, name=None):
117117

118118

119119
def with_id():
120-
return has_entry('id', not_none())
120+
return has_entry('uuid', not_none())
121121

122122

123123
def with_status(status):

0 commit comments

Comments
 (0)