Back to index

python3.2  3.2.2
Classes | Functions
lib2to3.tests.test_util Namespace Reference

Classes

class  MacroTestCase
class  Test_is_tuple
class  Test_is_list
class  Test_Attr
class  Test_Name
class  Test_Call
class  Test_does_tree_import
class  Test_find_binding
class  Test_touch_import
class  Test_find_indentation

Functions

def parse

Detailed Description

Test suite for the code in fixer_util 

Function Documentation

def lib2to3.tests.test_util.parse (   code,
  strip_levels = 0 
)

Definition at line 15 of file test_util.py.

00015 
00016 def parse(code, strip_levels=0):
00017     # The topmost node is file_input, which we don't care about.
00018     # The next-topmost node is a *_stmt node, which we also don't care about
00019     tree = support.parse_string(code)
00020     for i in range(strip_levels):
00021         tree = tree.children[0]
00022     tree.parent = None
00023     return tree

Here is the caller graph for this function: