]> granicus.if.org Git - python/commitdiff
and a unit test for the staticmethod-of-a-non-method failure just fixed
authorAnthony Baxter <anthonybaxter@gmail.com>
Mon, 2 Aug 2004 11:34:10 +0000 (11:34 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Mon, 2 Aug 2004 11:34:10 +0000 (11:34 +0000)
Lib/test/test_decorators.py

index 98d5d3eff7c9ccfca8577e7a67a9b7760e383bd8..ef40e17fad364ce61f0946084a54193599787f54 100644 (file)
@@ -78,6 +78,12 @@ class TestDecorators(unittest.TestCase):
         self.assertEqual(C.foo(), 42)
         self.assertEqual(C().foo(), 42)
 
+    def test_staticmethod_function(self):
+        @staticmethod
+        def notamethod(x): 
+            return x
+        self.assertRaises(TypeError, notamethod, 1)
+
     def test_dotted(self):
         decorators = MiscDecorators()
         @decorators.author('Cleese')