-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3343 from agullon/skip_rf_tests
USHIFT-2463: Add PreRunModifier flag to skip RF
- Loading branch information
Showing
2 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Pre-run modifier that skips tests by their name. | ||
Tests to skip are specified by Test Name | ||
""" | ||
|
||
import os | ||
from robot.api import SuiteVisitor | ||
|
||
|
||
class SkipTests(SuiteVisitor): | ||
|
||
def __init__(self, list_skip_test): | ||
self.list_skip_test = list_skip_test | ||
|
||
if self.list_skip_test: | ||
print("List of tests to be skipped:") | ||
print(f" - {self.list_skip_test.replace(',', f'{os.linesep} - ')}") | ||
else: | ||
print("No tests to be skipped") | ||
|
||
def visit_test(self, test): | ||
"""Set tag to skip tests""" | ||
|
||
# set `robot:skip` tag | ||
if test.name in self.list_skip_test.split(","): | ||
test.tags.add("robot:skip") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters