-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_run.py
45 lines (29 loc) · 951 Bytes
/
test_run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import bdb
import sys
import linecache
import pycharacterize
from tests import mytest
import tests
import logging
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
#logging.basicConfig(level=logging.INFO)
pych_obj = pycharacterize.runner.Runner(step_all=False)
pych_obj.set_class_to_watch(mytest.MyTest4, "tests.mytest.MyTest4")
pych_obj.do_runcall(mytest.manipulate_class, mytest.MyTest4)
print
print "---------------- All Calls"
print pych_obj.all_calls.items()
print pych_obj.class_counts.items()
print
print
print "!!!!!!!!!!!!!!!!!!!----------------"
print
test_code = pych_obj.output_test_code(backtrace=True)
print test_code
pych_obj.output_test_code_to_file("test_MyTest4.py", backtrace=False)
print
print "!!!!!!!!!!!!!!!!!!! RUNNING THE AUTOGEN ----------------"
print
exec(test_code)
print "------ DONe "