Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create test_generators.py
  • Loading branch information
Fidget-Spinner committed Jun 10, 2024
commit 3d23adaff6e325df53cefbd870c8b03103814890
23 changes: 23 additions & 0 deletions Lib/test/test_free_threading/test_generators.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import unittest
import concurrent.futures

from unittest import TestCase

from test.support import threading_helper

@threading_helper.requires_working_threading()
class TestGen(TestCase):
def test_generators_basic(self):
def gen():
for _ in range(5000):
yield


it = gen()
with concurrent.futures.ThreadPoolExecutor() as executor:
for _ in range(5000):
executor.submit(lambda: next(it))


if __name__ == "__main__":
unittest.main()