Skip to content

Commit 6337297

Browse files
skhomutiGilBecker-Anaplan
authored andcommitted
Add pytest-check integration test (via allure-framework#612)
1 parent 1e9b131 commit 6337297

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

allure-pytest/test/integration/pytest_check/__init__.py

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
import allure
3+
from allure_commons_test.report import has_test_case
4+
from allure_commons_test.result import with_status, with_message_contains, has_status_details
5+
from hamcrest import assert_that
6+
7+
8+
@allure.issue("376")
9+
@allure.feature("Integration")
10+
def test_pytest_check(allured_testdir):
11+
"""
12+
>>> import pytest_check as check
13+
>>> def test_pytest_check_example():
14+
... check.equal(1, 2, msg="First failure")
15+
... check.equal(1, 2, msg="Second failure")
16+
"""
17+
18+
allured_testdir.parse_docstring_source()
19+
allured_testdir.run_with_allure()
20+
21+
assert_that(allured_testdir.allure_report,
22+
has_test_case("test_pytest_check_example",
23+
with_status("failed"),
24+
has_status_details(with_message_contains("First failure"),
25+
with_message_contains("Second failure"))
26+
),
27+
28+
)

allure-pytest/tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ deps =
1616
{distshare}/allure-python-commons-?.*.zip
1717
pyhamcrest
1818
mock
19+
pytest-check
1920
pytest-flakes
2021
pytest-rerunfailures
2122
pytest-xdist
@@ -38,6 +39,7 @@ setenv = ALLURE_INDENT_OUTPUT=yep
3839

3940
deps =
4041
pyhamcrest
42+
pytest-check
4143
pytest-flakes
4244
pytest-rerunfailures
4345
pytest-xdist

0 commit comments

Comments
 (0)