]> granicus.if.org Git - python/commitdiff
add test for class with no operations defined
authorBenjamin Peterson <benjamin@python.org>
Sun, 11 Apr 2010 01:40:32 +0000 (01:40 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 11 Apr 2010 01:40:32 +0000 (01:40 +0000)
Lib/test/test_functools.py

index 05e19b1399fdd65bb215592a0a4a94706c929657..6e3533acd2a76c532bf028090ce0f3ba0f608bcd 100644 (file)
@@ -422,6 +422,12 @@ class TestTotalOrdering(unittest.TestCase):
         self.assert_(A(2) <= A(2))
         self.assert_(A(2) >= A(2))
 
+    def test_no_operations_defined(self):
+        with self.assertRaises(ValueError):
+            @functools.total_ordering
+            class A:
+                pass
+
 def test_main(verbose=None):
     test_classes = (
         TestPartial,