Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5ded632

Browse filesBrowse files
committed
ISSUE#616: Add test for labels with object
1 parent 8df0466 commit 5ded632
Copy full SHA for 5ded632

File tree

1 file changed

+21
-1
lines changed
Filter options

1 file changed

+21
-1
lines changed

‎allure-pytest/test/acceptance/label/bdd/bdd_label_test.py

Copy file name to clipboardExpand all lines: allure-pytest/test/acceptance/label/bdd/bdd_label_test.py
+21-1Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
""" ./examples/label/bdd/bdd_label.rst """
2+
import json
23

3-
from hamcrest import assert_that
4+
from hamcrest import assert_that, calling, is_not, raises
45
from allure_commons_test.report import has_test_case
56
from allure_commons_test.label import has_epic
67
from allure_commons_test.label import has_feature
@@ -29,3 +30,22 @@ def test_multiple_bdd_label(executed_docstring_path):
2930
has_story("Alternative story")
3031
)
3132
)
33+
34+
35+
def test_set_bdd_label_as_object(executed_docstring_source):
36+
"""
37+
>>> import allure
38+
39+
>>> class SomeClass:
40+
... pass
41+
42+
43+
>>> @allure.feature(SomeClass())
44+
... def test_set_label_as_object_example():
45+
... pass
46+
"""
47+
48+
assert_that(
49+
calling(json.dumps).with_args(executed_docstring_source.allure_report.test_cases),
50+
is_not(raises(TypeError, 'not JSON serializable'))
51+
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.