未验证 提交 6fcdf4be 编写于 作者: A Amador Pahim

Merge branch 'clebergnu-release_51_fixes'

Signed-off-by: NAmador Pahim <apahim@redhat.com>
......@@ -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
......
......@@ -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
"""
......
# -*- 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
......
......@@ -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)
......
......@@ -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',
......
......@@ -432,3 +432,5 @@ fc
ps
bsd
unexecuted
lossy
readthedocs
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册