Skip to content

Commit

Permalink
add test for getgeneratorstate as well
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Nov 26, 2023
1 parent 3dbe4c8 commit 4682555
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2384,6 +2384,10 @@ def test_closed_after_immediate_exception(self):
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.
Expand Down

0 comments on commit 4682555

Please sign in to comment.