diff options
author | Ceridwen <ceridwenv@gmail.com> | 2015-07-11 17:02:33 -0400 |
---|---|---|
committer | Ceridwen <ceridwenv@gmail.com> | 2015-07-11 17:02:33 -0400 |
commit | b63c90162e44e932b9ecc64ff8fa46cf66079c1c (patch) | |
tree | 94871910e289305d54926e558c66328d687d96ce /astroid/test_utils.py | |
parent | e6216b82884f324cc41a834725d2a992077d6a2d (diff) | |
parent | b1824e8f74232fac14e2600c28d53a320a94510e (diff) | |
download | astroid-git-b63c90162e44e932b9ecc64ff8fa46cf66079c1c.tar.gz |
Merge logilab/astroid again
Diffstat (limited to 'astroid/test_utils.py')
-rw-r--r-- | astroid/test_utils.py | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/astroid/test_utils.py b/astroid/test_utils.py index a7aba5e1..c1d63f17 100644 --- a/astroid/test_utils.py +++ b/astroid/test_utils.py @@ -1,7 +1,6 @@ """Utility functions for test code that uses astroid ASTs as input.""" import functools import sys -import textwrap from astroid import nodes from astroid import builder @@ -157,7 +156,7 @@ def extract_node(code, module_name=''): if line.strip().endswith(_STATEMENT_SELECTOR): requested_lines.append(idx + 1) - tree = build_module(code, module_name=module_name) + tree = builder.parse(code, module_name=module_name) extracted = [] # print(as_string.dump(tree)) if requested_lines: @@ -177,21 +176,6 @@ def extract_node(code, module_name=''): return extracted -def build_module(code, module_name='', path=None): - """Parses a string module with a builder. - :param code: The code for the module. - :type code: str - :param module_name: The name for the module - :type module_name: str - :param path: The path for the module - :type module_name: str - :returns: The module AST. - :rtype: astroid.bases.NodeNG - """ - code = textwrap.dedent(code) - return builder.AstroidBuilder(None).string_build(code, modname=module_name, path=path) - - def require_version(minver=None, maxver=None): """ Compare version of python interpreter to the given one. Skip the test if older. |