8000 gh-96471: Add threading queue shutdown by EpicWink · Pull Request #104750 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-96471: Add threading queue shutdown #104750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Prev Previous commit
Next Next commit
Remove typing in test script
  • Loading branch information
EpicWink committed Feb 8, 2024
commit 3570bd8f2bd5fb2a150e856086eedd208dd111db
20 changes: 2 additions & 18 deletions Lib/test/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
from test.support import import_helper
from test.support import threading_helper

import typing as t

if t.TYPE_CHECKING:
import queue

parent_class = unittest.TestCase

else:
parent_class = object

# queue module depends on threading primitives
threading_helper.requires_working_threading(module=True)

Expand Down Expand Up @@ -65,10 +55,7 @@ def run(self):
# is supposed to raise an exception, call do_exceptional_blocking_test()
# instead.

class BlockingTestMixin(parent_class):
if t.TYPE_CHECKING:
queue = queue
type2test: t.Type[queue.Queue]
class BlockingTestMixin:

def do_blocking_test(self, block_func, block_args, trigger_func, trigger_args):
thread = _TriggerThread(trigger_func, trigger_args)
Expand Down Expand Up @@ -810,10 +797,7 @@ class CFailingQueueTest(FailingQueueTest, unittest.TestCase):
queue = c_queue


class BaseSimpleQueueTest(parent_class):
if t.TYPE_CHECKING:
queue = queue
type2test: t.Type[queue.Queue]
class BaseSimpleQueueTest:

def setUp(self):
self.q = self.type2test()
Expand Down
0