summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-08-08 16:36:36 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-08-08 16:36:36 (GMT)
commit4e4f3b8d353803003c5f114a29f3b0ab1596fe24 (patch)
treef37aea1a894fcac63cf941c3ea7aa640b521a82f /Lib
parentcdd0279b0b5b32d888ad1987ce25f049029e426c (diff)
downloadcpython-4e4f3b8d353803003c5f114a29f3b0ab1596fe24.zip
cpython-4e4f3b8d353803003c5f114a29f3b0ab1596fe24.tar.gz
cpython-4e4f3b8d353803003c5f114a29f3b0ab1596fe24.tar.bz2
#18581: remove duplicate test and run a test class that was skipped. Initial patch by Vajrasky Kok.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_abc.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index 653c957..d4d7556 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -65,34 +65,6 @@ class TestLegacyAPI(unittest.TestCase):
self.assertEqual(D.foo(), 4)
self.assertEqual(D().foo(), 4)
- def test_abstractmethod_integration(self):
- for abstractthing in [abc.abstractmethod, abc.abstractproperty,
- abc.abstractclassmethod,
- abc.abstractstaticmethod]:
- class C(metaclass=abc.ABCMeta):
- @abstractthing
- def foo(self): pass # abstract
- def bar(self): pass # concrete
- self.assertEqual(C.__abstractmethods__, {"foo"})
- self.assertRaises(TypeError, C) # because foo is abstract
- self.assertTrue(isabstract(C))
- class D(C):
- def bar(self): pass # concrete override of concrete
- self.assertEqual(D.__abstractmethods__, {"foo"})
- self.assertRaises(TypeError, D) # because foo is still abstract
- self.assertTrue(isabstract(D))
- class E(D):
- def foo(self): pass
- self.assertEqual(E.__abstractmethods__, set())
- E() # now foo is concrete, too
- self.assertFalse(isabstract(E))
- class F(E):
- @abstractthing
- def bar(self): pass # abstract override of concrete
- self.assertEqual(F.__abstractmethods__, {"bar"})
- self.assertRaises(TypeError, F) # because bar is abstract now
- self.assertTrue(isabstract(F))
-
class TestABC(unittest.TestCase):
@@ -416,9 +388,5 @@ class TestABC(unittest.TestCase):
self.assertEqual(B.counter, 1)
-def test_main():
- support.run_unittest(TestABC)
-
-
if __name__ == "__main__":
unittest.main()