summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect/test_inspect.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_inspect/test_inspect.py')
-rw-r--r--Lib/test/test_inspect/test_inspect.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_inspect/test_inspect.py b/Lib/test/test_inspect/test_inspect.py
index becbb04..e75682f 100644
--- a/Lib/test/test_inspect/test_inspect.py
+++ b/Lib/test/test_inspect/test_inspect.py
@@ -2384,6 +2384,10 @@ class TestGetGeneratorState(unittest.TestCase):
self.generator.throw(RuntimeError)
self.assertEqual(self._generatorstate(), inspect.GEN_CLOSED)
+ def test_closed_after_close(self):
+ self.generator.close()
+ self.assertEqual(self._generatorstate(), inspect.GEN_CLOSED)
+
def test_running(self):
# As mentioned on issue #10220, checking for the RUNNING state only
# makes sense inside the generator itself.
@@ -2493,6 +2497,10 @@ class TestGetCoroutineState(unittest.TestCase):
self.coroutine.throw(RuntimeError)
self.assertEqual(self._coroutinestate(), inspect.CORO_CLOSED)
+ def test_closed_after_close(self):
+ self.coroutine.close()
+ self.assertEqual(self._coroutinestate(), inspect.CORO_CLOSED)
+
def test_easy_debugging(self):
# repr() and str() of a coroutine state should contain the state name
names = 'CORO_CREATED CORO_RUNNING CORO_SUSPENDED CORO_CLOSED'.split()