Skip to content

Commit 9c9da8f

Browse files
author
tw39124-1
committed
Add default value
1 parent ac493f0 commit 9c9da8f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

robotframework2testrail.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@
3030
logging.getLogger().addHandler(CONSOLE_HANDLER)
3131

3232

33+
DEFAULT_TAG_PREFIX = "test_case_id"
34+
35+
3336
class TestRailResultVisitor(ResultVisitor):
3437
""" Implement a `Visitor` that retrieves TestRail ID from Robot Framework Result """
3538

36-
def __init__(self, tag_prefix):
39+
def __init__(self, tag_prefix=DEFAULT_TAG_PREFIX):
3740
""" Init """
3841
if not isinstance(tag_prefix, str):
3942
raise ValueError("tag_prefix should be of type str, got %s" % type(tag_prefix))
@@ -222,7 +225,7 @@ def options():
222225
action='store_true',
223226
help='Do not publish results of "blocked" testcases in TestRail.')
224227
parser.add_argument(
225-
'--tag-prefix', dest='tag_prefix', default='test_case_id', help='Tag prefix to use if extracting testrail ID from tags. Default = \'test_case_id\''
228+
'--tag-prefix', dest='tag_prefix', default=DEFAULT_TAG_PREFIX, help='Tag prefix to use if extracting testrail ID from tags. Default = \'test_case_id\''
226229
)
227230

228231
group = parser.add_mutually_exclusive_group(required=True)

0 commit comments

Comments
 (0)