Skip to content

Commit 3f3ba87

Browse files
committed
apply suggestions from code review
1 parent 10efcb9 commit 3f3ba87

File tree

1 file changed

+9
-69
lines changed

1 file changed

+9
-69
lines changed

tests/allure_pytest/acceptance/label/tag/tag_test.py

Lines changed: 9 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from hamcrest import assert_that, not_
1+
from hamcrest import assert_that, not_, anything
22
from tests.allure_pytest.pytest_runner import AllurePytestRunner
33

44
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(
4747
has_test_case(
4848
"test_pytest_marker_with_args_is_not_converted_to_allure_tag_example",
4949
not_(
50-
has_tag("marker('cool', 'stuff')")
50+
has_tag(anything())
5151
)
5252
)
5353
)
@@ -71,43 +71,7 @@ def test_pytest_marker_with_kwargs_is_not_converted_to_allure_tag(
7171
has_test_case(
7272
"test_pytest_marker_with_kwargs_is_not_converted_to_allure_tag_example",
7373
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())
11175
)
11276
)
11377
)
@@ -131,7 +95,7 @@ def test_pytest_reserved_marker_usefixtures_is_not_converted_to_allure_tag(
13195
has_test_case(
13296
"test_pytest_reserved_marker_usefixtures_is_not_converted_to_allure_tag_example",
13397
not_(
134-
has_tag("usefixtures('test_fixture')")
98+
has_tag(anything())
13599
)
136100
)
137101
)
@@ -155,7 +119,7 @@ def test_pytest_reserved_marker_filterwarnings_is_not_converted_to_allure_tag(
155119
has_test_case(
156120
"test_pytest_reserved_marker_filterwarnings_is_not_converted_to_allure_tag_example",
157121
not_(
158-
has_tag("filterwarnings('ignore:val')")
122+
has_tag(anything())
159123
)
160124
)
161125
)
@@ -179,7 +143,7 @@ def test_pytest_reserved_marker_skip_is_not_converted_to_allure_tag(
179143
has_test_case(
180144
"test_pytest_reserved_marker_skip_is_not_converted_to_allure_tag_example",
181145
not_(
182-
has_tag("skip(reason='reason')")
146+
has_tag(anything())
183147
)
184148
)
185149
)
@@ -203,7 +167,7 @@ def test_pytest_reserved_marker_skipif_is_not_converted_to_allure_tag(
203167
has_test_case(
204168
"test_pytest_reserved_marker_skipif_is_not_converted_to_allure_tag_example",
205169
not_(
206-
has_tag("skipif(False, reason='reason')")
170+
has_tag(anything())
207171
)
208172
)
209173
)
@@ -227,7 +191,7 @@ def test_pytest_reserved_marker_xfail_is_not_converted_to_allure_tag(
227191
has_test_case(
228192
"test_pytest_reserved_marker_xfail_is_not_converted_to_allure_tag_example",
229193
not_(
230-
has_tag("xfail(reason='this is unexpect pass')")
194+
has_tag(anything())
231195
)
232196
)
233197
)
@@ -251,31 +215,7 @@ def test_pytest_reserved_marker_parametrize_is_not_converted_to_allure_tag(
251215
has_test_case(
252216
"test_pytest_reserved_marker_parametrize_is_not_converted_to_allure_tag_example[foo]",
253217
not_(
254-
has_tag("parametrize('param', ['foo'])")
218+
has_tag(anything())
255219
)
256220
)
257221
)
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

Comments
 (0)