summaryrefslogtreecommitdiff
path: root/astroid/test_utils.py
diff options
context:
space:
mode:
authorCeridwen <ceridwenv@gmail.com>2015-07-11 17:02:33 -0400
committerCeridwen <ceridwenv@gmail.com>2015-07-11 17:02:33 -0400
commitb63c90162e44e932b9ecc64ff8fa46cf66079c1c (patch)
tree94871910e289305d54926e558c66328d687d96ce /astroid/test_utils.py
parente6216b82884f324cc41a834725d2a992077d6a2d (diff)
parentb1824e8f74232fac14e2600c28d53a320a94510e (diff)
downloadastroid-git-b63c90162e44e932b9ecc64ff8fa46cf66079c1c.tar.gz
Merge logilab/astroid again
Diffstat (limited to 'astroid/test_utils.py')
-rw-r--r--astroid/test_utils.py18
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.