Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_profile Namespace Reference

Classes

class  ProfileTest

Functions

def regenerate_expected_output
def test_main
def main

Variables

dictionary _ProfileOutput = {}

Detailed Description

Test suite for the profile module.

Function Documentation

Definition at line 102 of file test_profile.py.

00102 
00103 def main():
00104     if '-r' not in sys.argv:
00105         test_main()
00106     else:
00107         regenerate_expected_output(__file__, ProfileTest)
00108 
00109 
00110 # Don't remove this comment. Everything below it is auto-generated.
#--cut--------------------------------------------------------------------------

Here is the call graph for this function:

def test.test_profile.regenerate_expected_output (   filename,
  cls 
)

Definition at line 78 of file test_profile.py.

00078 
00079 def regenerate_expected_output(filename, cls):
00080     filename = filename.rstrip('co')
00081     print('Regenerating %s...' % filename)
00082     results = cls.do_profiling()
00083 
00084     newfile = []
00085     with open(filename, 'r') as f:
00086         for line in f:
00087             newfile.append(line)
00088             if line.startswith('#--cut'):
00089                 break
00090 
00091     with open(filename, 'w') as f:
00092         f.writelines(newfile)
00093         f.write("_ProfileOutput = {}\n")
00094         for i, method in enumerate(cls.methodnames):
00095             f.write('_ProfileOutput[%r] = """\\\n%s"""\n' % (
00096                     method, results[i+1]))
00097         f.write('\nif __name__ == "__main__":\n    main()\n')
00098 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 99 of file test_profile.py.

00099 
00100 def test_main():
00101     run_unittest(ProfileTest)

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 111 of file test_profile.py.