Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test_unparse.DirectoryTestCase Class Reference
Inheritance diagram for test_unparse.DirectoryTestCase:
Inheritance graph
Collaboration diagram for test_unparse.DirectoryTestCase:
Collaboration graph

List of all members.

Public Member Functions

def test_files
def assertASTEqual
def check_roundtrip

Static Public Attributes

string test_directories = 'Lib'

Detailed Description

Test roundtrip behaviour on all files in Lib and Lib/test.

Definition at line 212 of file

Member Function Documentation

def test_unparse.ASTTestCase.assertASTEqual (   self,
) [inherited]

Definition at line 97 of file

00098     def assertASTEqual(self, ast1, ast2):
00099         self.assertEqual(ast.dump(ast1), ast.dump(ast2))

Here is the call graph for this function:

Here is the caller graph for this function:

def test_unparse.ASTTestCase.check_roundtrip (   self,
  filename = "internal" 
) [inherited]

Definition at line 100 of file

00101     def check_roundtrip(self, code1, filename="internal"):
00102         ast1 = compile(code1, filename, "exec", ast.PyCF_ONLY_AST)
00103         unparse_buffer = io.StringIO()
00104         unparse.Unparser(ast1, unparse_buffer)
00105         code2 = unparse_buffer.getvalue()
00106         ast2 = compile(code2, filename, "exec", ast.PyCF_ONLY_AST)
00107         self.assertASTEqual(ast1, ast2)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 218 of file

00219     def test_files(self):
00220         # get names of files to test
00221         dist_dir = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
00223         names = []
00224         for d in self.test_directories:
00225             test_dir = os.path.join(dist_dir, d)
00226             for n in os.listdir(test_dir):
00227                 if n.endswith('.py') and not n.startswith('bad'):
00228                     names.append(os.path.join(test_dir, n))
00230         for filename in names:
00231             if
00232                 print('Testing %s' % filename)
00233             source = read_pyfile(filename)
00234             self.check_roundtrip(source)

Here is the call graph for this function:

Member Data Documentation

Definition at line 216 of file

The documentation for this class was generated from the following file: