File tree Expand file tree Collapse file tree 6 files changed +50
-1
lines changed
test/acceptance/label/manual Expand file tree Collapse file tree 6 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1+ Test manual label
2+ -------------
3+
4+ By default, ``ALLURE_MANUAL `` label is not set.
5+
6+ Usage of ``allure.manual `` decorator.
7+
8+ >>> import allure
9+
10+
11+ >>> @ allure.manual
12+ ... def test_manual ():
13+ ... pass
14+
15+ >>> def test_manual_dynamic ():
16+ ... allure.dynamic.manual()
Original file line number Diff line number Diff line change 1+ from hamcrest import assert_that
2+ from allure_commons_test .report import has_test_case
3+ from allure_commons_test .label import has_label
4+
5+
6+ def test_allure_manual_label (executed_docstring_path ):
7+ """ ./examples/label/manual/allure_manual.rst """
8+ assert_that (executed_docstring_path .allure_report ,
9+ has_test_case ("test_manual" ,
10+ has_label ("ALLURE_MANUAL" , True )
11+ )
12+ )
13+
14+
15+ def test_allure_manual_label_dynamic (executed_docstring_path ):
16+ """ ./examples/label/manual/allure_manual.rst """
17+ assert_that (executed_docstring_path .allure_report ,
18+ has_test_case ("test_manual_dynamic" ,
19+ has_label ("ALLURE_MANUAL" , True )
20+ ),
21+ )
Original file line number Diff line number Diff line change 1010from allure_commons ._allure import Dynamic as dynamic
1111from allure_commons ._allure import step
1212from allure_commons ._allure import attach
13+ from allure_commons ._allure import manual
1314from allure_commons .types import Severity as severity_level
1415from allure_commons .types import AttachmentType as attachment_type
1516
3536 'dynamic' ,
3637 'severity_level' ,
3738 'attach' ,
38- 'attachment_type'
39+ 'attachment_type' ,
40+ 'manual'
3941]
Original file line number Diff line number Diff line change @@ -70,6 +70,10 @@ def id(id):
7070 return label (LabelType .ID , id )
7171
7272
73+ def manual (fn ):
74+ return label (LabelType .MANUAL , True )(fn )
75+
76+
7377def link (url , link_type = LinkType .LINK , name = None ):
7478 return safely (plugin_manager .hook .decorate_as_link (url = url , link_type = link_type , name = name ))
7579
@@ -140,6 +144,10 @@ def parent_suite(parent_suite_name):
140144 def sub_suite (sub_suite_name ):
141145 Dynamic .label (LabelType .SUB_SUITE , sub_suite_name )
142146
147+ @staticmethod
148+ def manual ():
149+ return Dynamic .label (LabelType .MANUAL , True )
150+
143151
144152def step (title ):
145153 if callable (title ):
@@ -170,6 +178,7 @@ def impl(*a, **kw):
170178 args = list (map (lambda x : represent (x ), a ))
171179 with StepContext (self .title .format (* args , ** params ), params ):
172180 return func (* a , ** kw )
181+
173182 return impl
174183
175184
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ class LabelType(str):
3131 ID = 'as_id'
3232 FRAMEWORK = 'framework'
3333 LANGUAGE = 'language'
34+ MANUAL = 'ALLURE_MANUAL'
3435
3536
3637class AttachmentType (Enum ):
You can’t perform that action at this time.
0 commit comments