diff --git a/avocado/core/loader.py b/avocado/core/loader.py index efbaebdcaabbc0343f04648041dbd0509d8b268a..21257a7b47750540d0d4268b87f6d2b56bd3174a 100644 --- a/avocado/core/loader.py +++ b/avocado/core/loader.py @@ -658,22 +658,25 @@ class FileLoader(TestLoader): docstring = ast.get_docstring(statement) # Looking for a class that has in the docstring either # ":avocado: enable" or ":avocado: disable - if (safeloader.check_docstring_directive(docstring, 'disable') - and class_name is None): + has_disable = safeloader.check_docstring_directive(docstring, + 'disable') + if (has_disable and class_name is None): continue cl_tags = safeloader.get_docstring_directives_tags(docstring) - if (safeloader.check_docstring_directive(docstring, 'enable') - and class_name is None): + has_enable = safeloader.check_docstring_directive(docstring, + 'enable') + if (has_enable and class_name is None): info = self._get_methods_info(statement.body, cl_tags) result[statement.name] = info continue # Looking for the 'recursive' docstring or a 'class_name' # (meaning we are under recursion) - if (safeloader.check_docstring_directive(docstring, 'recursive') - or class_name is not None): + has_recurse = safeloader.check_docstring_directive(docstring, + 'recursive') + if (has_recurse or class_name is not None): info = self._get_methods_info(statement.body, cl_tags) result[statement.name] = info diff --git a/avocado/core/varianter.py b/avocado/core/varianter.py index 725a06efe8410ce88643ebd9ad9c4882f0eec6a4..b6461bf73eada77f0f8278d65e378c017d28612c 100644 --- a/avocado/core/varianter.py +++ b/avocado/core/varianter.py @@ -456,17 +456,17 @@ class Varianter(object): 'variant_id': str, 'variant': [(str, [(str, str, object), ...])], {'mux_path': ['/run/*'], - 'variant_id': 'aaa-26c0' - 'variant': [('/foo/aaa', - [('/foo', 'bar', 'baz'), - ('/foo/aaa', 'bbb', 'ccc')])]} + 'variant_id': 'cat-26c0' + 'variant': [('/pig/cat', + [('/pig', 'ant', 'fox'), + ('/pig/cat', 'dog', 'bee')])]} ...] where `dump_tree_nodes` looks like:: [(node.path, environment_representation), (node.path, [(path1, key1, value1), (path2, key2, value2), ...]), - ('/foo/aaa', [('/foo', 'bar', 'baz')]) + ('/pig/cat', [('/pig', 'ant', 'fox')]) :return: loadable Varianter representation """ diff --git a/docs/source/conf.py b/docs/source/conf.py index d1108fcc39995a5fb4b007f0dfed486d85064346..dbbc08943b43a69f5cb8768ce2e584cdc2c486ef 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import errno +import importlib import os import sys @@ -123,6 +124,11 @@ The following pages document the private APIs of optional Avocado plugins. """) for path in os.walk(optional_plugins_path).next()[1]: name = "avocado_%s" % os.path.basename(path) + try: + importlib.import_module(name) + except ImportError: + continue + path = os.path.join(optional_plugins_path, path, name) if not os.path.exists(path): continue diff --git a/selftests/unit/test_safeloader.py b/selftests/unit/test_safeloader.py index 22092ff452d1b377301cc2f2427bcc5a2b8b16ae..ea9f7d96ab32ad5f62becd0e6da55535e4498bd6 100644 --- a/selftests/unit/test_safeloader.py +++ b/selftests/unit/test_safeloader.py @@ -127,7 +127,7 @@ class DocstringDirectives(unittest.TestCase): def test_directives_regex(self): """ - Tests the documented regexes for dealing with docstring directives + Tests the regular expressions that deal with docstring directives """ for directive in self.VALID_DIRECTIVES: self.assertRegexpMatches(directive, safeloader.DOCSTRING_DIRECTIVE_RE) diff --git a/setup.py b/setup.py index 0b4a4f26bdef4505a0380c982d7ecbc16626a5b8..a6c84303ffd05817d38dfcd84cc160a2df62fce6 100755 --- a/setup.py +++ b/setup.py @@ -104,7 +104,7 @@ def get_long_description(): if __name__ == '__main__': - # Force "make develop" inside READTHEDOCS environment + # Force "make develop" inside the "readthedocs.org" environment if os.environ.get("READTHEDOCS") and "install" in sys.argv: os.system("make develop") setup(name='avocado-framework', diff --git a/spell.ignore b/spell.ignore index d481cc58db02e8fae9abf8e282caa9722f13dfb2..6e26c7a2511a094c9af38e97026c6ac04b4050dd 100644 --- a/spell.ignore +++ b/spell.ignore @@ -432,3 +432,5 @@ fc ps bsd unexecuted +lossy +readthedocs