Skip to content

Commit

Permalink
Add default value
Browse files Browse the repository at this point in the history
  • Loading branch information
tw39124-1 committed Jun 8, 2021
1 parent ac493f0 commit 9c9da8f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions robotframework2testrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
logging.getLogger().addHandler(CONSOLE_HANDLER)


DEFAULT_TAG_PREFIX = "test_case_id"


class TestRailResultVisitor(ResultVisitor):
""" Implement a `Visitor` that retrieves TestRail ID from Robot Framework Result """

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

group = parser.add_mutually_exclusive_group(required=True)
Expand Down

0 comments on commit 9c9da8f

Please sign in to comment.