mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
move helper function into its test method (closes #19112)
This commit is contained in:
parent
52010b40f6
commit
cc6ef3620f
1 changed files with 6 additions and 7 deletions
|
@ -3123,13 +3123,6 @@ def _ThisSubProcess(q):
|
|||
except pyqueue.Empty:
|
||||
pass
|
||||
|
||||
def _TestProcess(q):
|
||||
queue = multiprocessing.Queue()
|
||||
subProc = multiprocessing.Process(target=_ThisSubProcess, args=(queue,))
|
||||
subProc.daemon = True
|
||||
subProc.start()
|
||||
subProc.join()
|
||||
|
||||
def _afunc(x):
|
||||
return x*x
|
||||
|
||||
|
@ -3163,6 +3156,12 @@ class _file_like(object):
|
|||
class TestStdinBadfiledescriptor(unittest.TestCase):
|
||||
|
||||
def test_queue_in_process(self):
|
||||
def _TestProcess(q):
|
||||
queue = multiprocessing.Queue()
|
||||
subProc = multiprocessing.Process(target=_ThisSubProcess, args=(queue,))
|
||||
subProc.daemon = True
|
||||
subProc.start()
|
||||
subProc.join()
|
||||
queue = multiprocessing.Queue()
|
||||
proc = multiprocessing.Process(target=_TestProcess, args=(queue,))
|
||||
proc.start()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue