[Python-checkins] python/dist/src/Lib/test test_profile.py,1.2,1.3

mondragon at users.sourceforge.net mondragon at users.sourceforge.net
Mon Mar 22 15:12:57 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12193/Lib/test
Modified Files:
	test_profile.py 
Log Message:
Added global runctx function to profile to fix SF Bug #716587
Index: test_profile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_profile.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** test_profile.py	4 Oct 2001 05:36:56 -0000	1.2
--- test_profile.py	22 Mar 2004 20:12:55 -0000	1.3
***************
*** 2,5 ****
--- 2,7 ----
 
 import profile
+ import os
+ from test.test_support import TESTFN, vereq
 
 # In order to have reproducible time, we simulate a timer in the global
***************
*** 83,86 ****
--- 85,100 ----
 raise AttributeError
 
+ 
+ def test_2():
+ d = globals().copy()
+ def testfunc():
+ global x
+ x = 1
+ d['testfunc'] = testfunc
+ profile.runctx("testfunc()", d, d, TESTFN)
+ vereq (x, 1)
+ os.unlink (TESTFN)
+ 
 if __name__ == "__main__":
 test_main()
+ test_2()


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /