Skip to content

Commit

Permalink
WIP: make tags available as property on tags
Browse files Browse the repository at this point in the history
On some situations, the same information may be given on tags that can
be reused during test runtime.  Let's create a property to allow read
only access to these tags.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
  • Loading branch information
clebergnu committed Oct 19, 2018
1 parent ba4b2b1 commit 7c5b04e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 0 additions & 4 deletions avocado/core/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@ def load_test(self, test_factory):
:return: an instance of :class:`avocado.core.test.Test`.
"""
test_class, test_parameters = test_factory
# discard tags, as they are *not* intended to be parameters
# for the test, but used previously during filtering
if 'tags' in test_parameters:
del(test_parameters['tags'])
if 'modulePath' in test_parameters:
test_path = test_parameters.pop('modulePath')
else:
Expand Down
10 changes: 9 additions & 1 deletion avocado/core/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class Test(unittest.TestCase, TestData):
timeout = None

def __init__(self, methodName='test', name=None, params=None,
base_logdir=None, job=None, runner_queue=None):
base_logdir=None, job=None, runner_queue=None, tags=None):
"""
Initializes the test.
Expand Down Expand Up @@ -349,6 +349,7 @@ def record_and_warn(*args, **kwargs):
self.__name = TestID(0, self.__class__.__name__)

self.__job = job
self.__tags = tags

if base_logdir is None:
base_logdir = data_dir.create_job_logs_dir()
Expand Down Expand Up @@ -443,6 +444,13 @@ def job(self):
"""
return self.__job

@property
def tags(self):
"""
The avocado tags associated with this test
"""
return self.__tags

@property
def log(self):
"""
Expand Down

0 comments on commit 7c5b04e

Please sign in to comment.