1
- from hamcrest import assert_that , not_
1
+ from hamcrest import assert_that , not_ , anything
2
2
from tests .allure_pytest .pytest_runner import AllurePytestRunner
3
3
4
4
from allure_commons_test .report import has_test_case
@@ -47,7 +47,7 @@ def test_pytest_marker_with_args_is_not_converted_to_allure_tag(
47
47
has_test_case (
48
48
"test_pytest_marker_with_args_is_not_converted_to_allure_tag_example" ,
49
49
not_ (
50
- has_tag ("marker('cool', 'stuff')" )
50
+ has_tag (anything () )
51
51
)
52
52
)
53
53
)
@@ -71,43 +71,7 @@ def test_pytest_marker_with_kwargs_is_not_converted_to_allure_tag(
71
71
has_test_case (
72
72
"test_pytest_marker_with_kwargs_is_not_converted_to_allure_tag_example" ,
73
73
not_ (
74
- has_tag ("marker(stuff='cool')" )
75
- )
76
- )
77
- )
78
-
79
-
80
- def test_pytest_multiple_simple_and_reserved_markers_to_allure_tags (
81
- allure_pytest_runner : AllurePytestRunner
82
- ):
83
- """
84
- >>> import pytest
85
-
86
- >>> @pytest.mark.usermark1
87
- ... @pytest.mark.usermark2
88
- ... @pytest.mark.parametrize("param", ["foo"])
89
- ... @pytest.mark.skipif(False, reason="reason2")
90
- ... @pytest.mark.skipif(False, reason="reason1")
91
- ... def test_pytest_multiple_simple_and_reserved_markers_to_allure_tags_example(param):
92
- ... pass
93
- """
94
-
95
- allure_results = allure_pytest_runner .run_docstring ()
96
-
97
- assert_that (
98
- allure_results ,
99
- has_test_case (
100
- "test_pytest_multiple_simple_and_reserved_markers_to_allure_tags_example[foo]" ,
101
- has_tag ("usermark1" ),
102
- has_tag ("usermark2" ),
103
- not_ (
104
- has_tag ("skipif(False, reason='reason1')" )
105
- ),
106
- not_ (
107
- has_tag ("skipif(False, reason='reason2')" )
108
- ),
109
- not_ (
110
- has_tag ("parametrize('param', ['foo'])" )
74
+ has_tag (anything ())
111
75
)
112
76
)
113
77
)
@@ -131,7 +95,7 @@ def test_pytest_reserved_marker_usefixtures_is_not_converted_to_allure_tag(
131
95
has_test_case (
132
96
"test_pytest_reserved_marker_usefixtures_is_not_converted_to_allure_tag_example" ,
133
97
not_ (
134
- has_tag ("usefixtures('test_fixture')" )
98
+ has_tag (anything () )
135
99
)
136
100
)
137
101
)
@@ -155,7 +119,7 @@ def test_pytest_reserved_marker_filterwarnings_is_not_converted_to_allure_tag(
155
119
has_test_case (
156
120
"test_pytest_reserved_marker_filterwarnings_is_not_converted_to_allure_tag_example" ,
157
121
not_ (
158
- has_tag ("filterwarnings('ignore:val')" )
122
+ has_tag (anything () )
159
123
)
160
124
)
161
125
)
@@ -179,7 +143,7 @@ def test_pytest_reserved_marker_skip_is_not_converted_to_allure_tag(
179
143
has_test_case (
180
144
"test_pytest_reserved_marker_skip_is_not_converted_to_allure_tag_example" ,
181
145
not_ (
182
- has_tag ("skip(reason='reason')" )
146
+ has_tag (anything () )
183
147
)
184
148
)
185
149
)
@@ -203,7 +167,7 @@ def test_pytest_reserved_marker_skipif_is_not_converted_to_allure_tag(
203
167
has_test_case (
204
168
"test_pytest_reserved_marker_skipif_is_not_converted_to_allure_tag_example" ,
205
169
not_ (
206
- has_tag ("skipif(False, reason='reason')" )
170
+ has_tag (anything () )
207
171
)
208
172
)
209
173
)
@@ -227,7 +191,7 @@ def test_pytest_reserved_marker_xfail_is_not_converted_to_allure_tag(
227
191
has_test_case (
228
192
"test_pytest_reserved_marker_xfail_is_not_converted_to_allure_tag_example" ,
229
193
not_ (
230
- has_tag ("xfail(reason='this is unexpect pass')" )
194
+ has_tag (anything () )
231
195
)
232
196
)
233
197
)
@@ -251,31 +215,7 @@ def test_pytest_reserved_marker_parametrize_is_not_converted_to_allure_tag(
251
215
has_test_case (
252
216
"test_pytest_reserved_marker_parametrize_is_not_converted_to_allure_tag_example[foo]" ,
253
217
not_ (
254
- has_tag ("parametrize('param', ['foo'])" )
218
+ has_tag (anything () )
255
219
)
256
220
)
257
221
)
258
-
259
-
260
- def test_pytest_simple_markers_utf_encoding_are_converted_to_allure_tags (
261
- allure_pytest_runner : AllurePytestRunner
262
- ):
263
- """
264
- >>> import pytest
265
-
266
- >>> @pytest.mark.классная
267
- >>> @pytest.mark.штука
268
- ... def test_pytest_simple_markers_utf_encoding_are_converted_to_allure_tags_example():
269
- ... pass
270
- """
271
-
272
- allure_results = allure_pytest_runner .run_docstring ()
273
-
274
- assert_that (
275
- allure_results ,
276
- has_test_case (
277
- "test_pytest_simple_markers_utf_encoding_are_converted_to_allure_tags_example" ,
278
- has_tag ("классная" ),
279
- has_tag ("штука" )
280
- )
281
- )
0 commit comments