summaryrefslogtreecommitdiff
path: root/Lib/test/test_class.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_class.py')
-rw-r--r--Lib/test/test_class.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py
index e3883d67b7..4d554a397b 100644
--- a/Lib/test/test_class.py
+++ b/Lib/test/test_class.py
@@ -2,7 +2,6 @@
import unittest
-from test import support
testmeths = [
@@ -13,6 +12,8 @@ testmeths = [
"rsub",
"mul",
"rmul",
+ "matmul",
+ "rmatmul",
"truediv",
"rtruediv",
"floordiv",
@@ -177,6 +178,14 @@ class ClassTests(unittest.TestCase):
self.assertCallStack([("__rmul__", (testme, 1))])
callLst[:] = []
+ testme @ 1
+ self.assertCallStack([("__matmul__", (testme, 1))])
+
+ callLst[:] = []
+ 1 @ testme
+ self.assertCallStack([("__rmatmul__", (testme, 1))])
+
+ callLst[:] = []
testme / 1
self.assertCallStack([("__truediv__", (testme, 1))])
@@ -491,10 +500,10 @@ class ClassTests(unittest.TestCase):
try:
a() # This should not segfault
- except RuntimeError:
+ except RecursionError:
pass
else:
- self.fail("Failed to raise RuntimeError")
+ self.fail("Failed to raise RecursionError")
def testForExceptionsRaisedInInstanceGetattr2(self):
# Tests for exceptions raised in instance_getattr2().
@@ -559,8 +568,5 @@ class ClassTests(unittest.TestCase):
a = A(hash(A.f)^(-1))
hash(a.f)
-def test_main():
- support.run_unittest(ClassTests)
-
-if __name__=='__main__':
- test_main()
+if __name__ == '__main__':
+ unittest.main()