Skip to content

Commit 9c4edde

Browse files
author
tw39124-1
committed
Add default value
1 parent 9cfe124 commit 9c4edde

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))
@@ -231,7 +234,7 @@ def options():
231234
action='store_true',
232235
help='Do not publish results of "blocked" testcases in TestRail.')
233236
parser.add_argument(
234-
'--tag-prefix', dest='tag_prefix', default='test_case_id', help='Tag prefix to use if extracting testrail ID from tags. Default = \'test_case_id\''
237+
'--tag-prefix', dest='tag_prefix', default=DEFAULT_TAG_PREFIX, help='Tag prefix to use if extracting testrail ID from tags. Default = \'test_case_id\''
235238
)
236239

237240
group = parser.add_mutually_exclusive_group(required=True)

0 commit comments

Comments
 (0)