未验证 提交 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): ...@@ -658,22 +658,25 @@ class FileLoader(TestLoader):
docstring = ast.get_docstring(statement) docstring = ast.get_docstring(statement)
# Looking for a class that has in the docstring either # Looking for a class that has in the docstring either
# ":avocado: enable" or ":avocado: disable # ":avocado: enable" or ":avocado: disable
if (safeloader.check_docstring_directive(docstring, 'disable') has_disable = safeloader.check_docstring_directive(docstring,
and class_name is None): 'disable')
if (has_disable and class_name is None):
continue continue
cl_tags = safeloader.get_docstring_directives_tags(docstring) cl_tags = safeloader.get_docstring_directives_tags(docstring)
if (safeloader.check_docstring_directive(docstring, 'enable') has_enable = safeloader.check_docstring_directive(docstring,
and class_name is None): 'enable')
if (has_enable and class_name is None):
info = self._get_methods_info(statement.body, cl_tags) info = self._get_methods_info(statement.body, cl_tags)
result[statement.name] = info result[statement.name] = info
continue continue
# Looking for the 'recursive' docstring or a 'class_name' # Looking for the 'recursive' docstring or a 'class_name'
# (meaning we are under recursion) # (meaning we are under recursion)
if (safeloader.check_docstring_directive(docstring, 'recursive') has_recurse = safeloader.check_docstring_directive(docstring,
or class_name is not None): 'recursive')
if (has_recurse or class_name is not None):
info = self._get_methods_info(statement.body, cl_tags) info = self._get_methods_info(statement.body, cl_tags)
result[statement.name] = info result[statement.name] = info
......
...@@ -456,17 +456,17 @@ class Varianter(object): ...@@ -456,17 +456,17 @@ class Varianter(object):
'variant_id': str, 'variant_id': str,
'variant': [(str, [(str, str, object), ...])], 'variant': [(str, [(str, str, object), ...])],
{'mux_path': ['/run/*'], {'mux_path': ['/run/*'],
'variant_id': 'aaa-26c0' 'variant_id': 'cat-26c0'
'variant': [('/foo/aaa', 'variant': [('/pig/cat',
[('/foo', 'bar', 'baz'), [('/pig', 'ant', 'fox'),
('/foo/aaa', 'bbb', 'ccc')])]} ('/pig/cat', 'dog', 'bee')])]}
...] ...]
where `dump_tree_nodes` looks like:: where `dump_tree_nodes` looks like::
[(node.path, environment_representation), [(node.path, environment_representation),
(node.path, [(path1, key1, value1), (path2, key2, value2), ...]), (node.path, [(path1, key1, value1), (path2, key2, value2), ...]),
('/foo/aaa', [('/foo', 'bar', 'baz')]) ('/pig/cat', [('/pig', 'ant', 'fox')])
:return: loadable Varianter representation :return: loadable Varianter representation
""" """
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import errno import errno
import importlib
import os import os
import sys import sys
...@@ -123,6 +124,11 @@ The following pages document the private APIs of optional Avocado plugins. ...@@ -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]: for path in os.walk(optional_plugins_path).next()[1]:
name = "avocado_%s" % os.path.basename(path) name = "avocado_%s" % os.path.basename(path)
try:
importlib.import_module(name)
except ImportError:
continue
path = os.path.join(optional_plugins_path, path, name) path = os.path.join(optional_plugins_path, path, name)
if not os.path.exists(path): if not os.path.exists(path):
continue continue
......
...@@ -127,7 +127,7 @@ class DocstringDirectives(unittest.TestCase): ...@@ -127,7 +127,7 @@ class DocstringDirectives(unittest.TestCase):
def test_directives_regex(self): 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: for directive in self.VALID_DIRECTIVES:
self.assertRegexpMatches(directive, safeloader.DOCSTRING_DIRECTIVE_RE) self.assertRegexpMatches(directive, safeloader.DOCSTRING_DIRECTIVE_RE)
......
...@@ -104,7 +104,7 @@ def get_long_description(): ...@@ -104,7 +104,7 @@ def get_long_description():
if __name__ == '__main__': 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: if os.environ.get("READTHEDOCS") and "install" in sys.argv:
os.system("make develop") os.system("make develop")
setup(name='avocado-framework', setup(name='avocado-framework',
......
...@@ -432,3 +432,5 @@ fc ...@@ -432,3 +432,5 @@ fc
ps ps
bsd bsd
unexecuted unexecuted
lossy
readthedocs
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册