Skip to content

Commit 2548969

Browse files
authored
improve allure-pytest testing (via #356)
1 parent 22addd7 commit 2548969

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from hamcrest import assert_that
2+
from allure_commons_test.report import has_test_case
3+
from allure_commons_test.result import has_attachment
4+
5+
6+
def test_class_method_attachment(executed_docstring_source):
7+
"""
8+
>>> import allure
9+
10+
>>> class TestClass(object):
11+
... def test_class_method_attachment(self):
12+
... allure.attach("text", "failed", allure.attachment_type.TEXT)
13+
"""
14+
15+
assert_that(executed_docstring_source.allure_report,
16+
has_test_case("test_class_method_attachment",
17+
has_attachment(name="failed")
18+
)
19+
)

allure-pytest/test/integration/pytest_flakes/pytest_flakes_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import allure
12
from hamcrest import assert_that
23
from allure_commons_test.report import has_test_case
34
from allure_commons_test.result import with_status
45

56

7+
@allure.issue("352")
68
def test_pytest_flakes(allured_testdir):
79
"""
810
>>> from os.path import *

0 commit comments

Comments
 (0)