summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_contextlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_contextlib.py')
-rw-r--r--Lib/test/test_contextlib.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py
index b1a467d..2301f75 100644
--- a/Lib/test/test_contextlib.py
+++ b/Lib/test/test_contextlib.py
@@ -44,6 +44,16 @@ class TestAbstractContextManager(unittest.TestCase):
self.assertTrue(issubclass(DefaultEnter, AbstractContextManager))
+ class NoEnter(ManagerFromScratch):
+ __enter__ = None
+
+ self.assertFalse(issubclass(NoEnter, AbstractContextManager))
+
+ class NoExit(ManagerFromScratch):
+ __exit__ = None
+
+ self.assertFalse(issubclass(NoExit, AbstractContextManager))
+
class ContextManagerTestCase(unittest.TestCase):