[Python-checkins] python/dist/src/Lib/test test_builtin.py, 1.38, 1.39

gvanrossum at users.sourceforge.net gvanrossum at users.sourceforge.net
Sun Jan 16 01:21:32 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29517
Modified Files:
	test_builtin.py 
Log Message:
Use decorators.
Index: test_builtin.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- test_builtin.py	7 Dec 2004 21:17:46 -0000	1.38
+++ test_builtin.py	16 Jan 2005 00:21:28 -0000	1.39
@@ -1274,17 +1274,18 @@
 self.assertRaises(ValueError, unichr, sys.maxunicode+1)
 self.assertRaises(TypeError, unichr)
 
+ # We don't want self in vars(), so these are static methods
+
+ @staticmethod
 def get_vars_f0():
 return vars()
- # we don't want self in vars(), so use staticmethod
- get_vars_f0 = staticmethod(get_vars_f0)
 
+ @staticmethod
 def get_vars_f2():
 BuiltinTest.get_vars_f0()
 a = 1
 b = 2
 return vars()
- get_vars_f2 = staticmethod(get_vars_f2)
 
 def test_vars(self):
 self.assertEqual(set(vars()), set(dir()))


More information about the Python-checkins mailing list

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