Skip to content

Commit 801408a

Browse files
authored
Qaaaaaaaa patch 1 (#1)
* Update setup.py * Update utils.py * Update listener.py
1 parent c1fc261 commit 801408a

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

allure-pytest/setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
]
4242

4343

44-
def prepare_version():
45-
from setuptools_scm import get_version
46-
configuration = {"root": "..", "relative_to": __file__}
47-
version = get_version(**configuration)
48-
install_requires.append(f"allure-python-commons=={version}")
49-
return configuration
44+
# def prepare_version():
45+
# from setuptools_scm import get_version
46+
# configuration = {"root": "..", "relative_to": __file__}
47+
# version = get_version(**configuration)
48+
# install_requires.append(f"allure-python-commons=={version}")
49+
# return configuration
5050

5151

5252
def get_readme(fname):

allure-pytest/src/listener.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,14 @@ def pytest_runtest_makereport(self, item, call):
223223
if test_result.status == Status.PASSED:
224224
test_result.status = status
225225
test_result.statusDetails = status_details
226+
227+
if status in (Status.FAILED, Status.BROKEN):
228+
test_result.status = Status.FAILED
229+
test_result.statusDetails = status_details
226230

227231
if report.when == 'teardown':
228-
if status in (Status.FAILED, Status.BROKEN) and test_result.status == Status.PASSED:
229-
test_result.status = status
232+
if status in (Status.FAILED, Status.BROKEN):
233+
test_result.status = Status.FAILED
230234
test_result.statusDetails = status_details
231235

232236
if self.config.option.attach_capture:

allure-pytest/src/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ def get_outcome_status_details(outcome):
155155

156156
def get_status(exception):
157157
if exception:
158-
return Status.FAILED
158+
if isinstance(exception, AssertionError) or isinstance(exception, pytest.fail.Exception):
159+
return Status.FAILED
160+
elif isinstance(exception, pytest.skip.Exception):
161+
return Status.SKIPPED
162+
return Status.BROKEN
159163
else:
160164
return Status.PASSED
161165

0 commit comments

Comments
 (0)