diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2015-10-08 12:04:30 -0700 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2015-10-09 12:23:37 -0700 |
commit | d387894da523fb0fd7f7c108a752fa641b4a4cb4 (patch) | |
tree | 7671b15a41dea4315ef6914344a6dc05ed675c9e | |
parent | 6b85f148961e2d6108266fd5aff75734c7cf4c35 (diff) |
framework/tests: replace custom decorator with nose's attr decorator
This is a more standard way to mark tests out as special case, and not
rolling our own code is good.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r-- | framework/tests/dmesg_tests.py | 7 | ||||
-rw-r--r-- | framework/tests/utils.py | 12 |
2 files changed, 4 insertions, 15 deletions
diff --git a/framework/tests/dmesg_tests.py b/framework/tests/dmesg_tests.py index 618994c0c..8ef7e0eb3 100644 --- a/framework/tests/dmesg_tests.py +++ b/framework/tests/dmesg_tests.py @@ -36,6 +36,7 @@ except ImportError: import json import nose.tools as nt from nose.plugins.skip import SkipTest +from nose.plugins.attrib import attr from framework import dmesg, status import framework.core @@ -150,7 +151,7 @@ def test_get_dmesg_linux(): "but it actually returned {}".format(type(posix)))) -@utils.privileged_test +@attr('privliged') def test_update_dmesg_with_updates(): """dmesg.Dmesg.update_dmesg(): updates results when there is a new entry in dmesg @@ -172,7 +173,7 @@ def test_update_dmesg_with_updates(): "has been updated.".format(test.__class__))) -@utils.privileged_test +@attr('privliged') def test_update_dmesg_without_updates(): """dmesg.Dmesg.update_dmesg(): does not update results when there is no change in dmesg @@ -381,7 +382,7 @@ def test_json_serialize_updated_result(): encoder.encode(result) -@privileged_generator +@attr('privliged') def test_testclasses_dmesg(): """ Generator that creates tests for """ lists = [(framework.test.PiglitGLTest, ['attribs'], 'PiglitGLTest'), diff --git a/framework/tests/utils.py b/framework/tests/utils.py index 6ad2ff0d3..2a9370c91 100644 --- a/framework/tests/utils.py +++ b/framework/tests/utils.py @@ -292,18 +292,6 @@ def nose_generator(func): return test_wrapper -def privileged_test(func): - """ Wrapper to name the tests as sudo - - This makes the name of the function contain begin with sudo, which is - useful for excluding tests with privileged execution requirements - - """ - func.__name__ = 'sudo_' + func.__name__ - - return func - - def binary_check(bin_, errno_=None): """Check for the existance of a binary or raise SkipTest. |