summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-01-12 15:42:34 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-01-12 15:42:34 (GMT)
commitde368717dad90577e4f491d3f4187742a7d00515 (patch)
tree4edbbd20931fba6e432f183c3d8ee4a5d69472c1 /Lib
parent6e1d0a829ddd4db0b099878f820d36f5e32a0f03 (diff)
downloadcpython-de368717dad90577e4f491d3f4187742a7d00515.zip
cpython-de368717dad90577e4f491d3f4187742a7d00515.tar.gz
cpython-de368717dad90577e4f491d3f4187742a7d00515.tar.bz2
Merged revisions 87952-87954 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87952 | benjamin.peterson | 2011-01-12 09:24:27 -0600 (Wed, 12 Jan 2011) | 1 line move this test to test_descr; it's not abc specific ........ r87953 | benjamin.peterson | 2011-01-12 09:25:02 -0600 (Wed, 12 Jan 2011) | 1 line oops, wrong class ........ r87954 | benjamin.peterson | 2011-01-12 09:34:01 -0600 (Wed, 12 Jan 2011) | 1 line don't segfault on deleting __abstractmethods__ #10892 ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_abc.py7
-rw-r--r--Lib/test/test_descr.py11
2 files changed, 11 insertions, 7 deletions
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index 0fa40cb..3aef4a0 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -60,13 +60,6 @@ class TestABC(unittest.TestCase):
self.assertRaises(TypeError, F) # because bar is abstract now
self.assertTrue(isabstract(F))
- def test_type_has_no_abstractmethods(self):
- # type pretends not to have __abstractmethods__.
- self.assertRaises(AttributeError, getattr, type, "__abstractmethods__")
- class meta(type):
- pass
- self.assertRaises(AttributeError, getattr, meta, "__abstractmethods__")
-
def test_metaclass_abc(self):
# Metaclasses can be ABCs, too.
class A(metaclass=abc.ABCMeta):
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index e1c928f..97a4e4b 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -4224,6 +4224,17 @@ order (MRO) for bases """
self.assertRaises(AttributeError, getattr, EvilGetattribute(), "attr")
+ def test_abstractmethods(self):
+ # type pretends not to have __abstractmethods__.
+ self.assertRaises(AttributeError, getattr, type, "__abstractmethods__")
+ class meta(type):
+ pass
+ self.assertRaises(AttributeError, getattr, meta, "__abstractmethods__")
+ class X(object):
+ pass
+ with self.assertRaises(AttributeError):
+ del X.__abstractmethods__
+
class DictProxyTests(unittest.TestCase):
def setUp(self):