MCPcopy Index your code
hub / github.com/python/cpython / test_args_argument

Method test_args_argument

Lib/test/_test_multiprocessing.py:400–418  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

398 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
399 @support.requires_resource('cpu')
400 def test_args_argument(self):
401 # bpo-45735: Using list or tuple as *args* in constructor could
402 # achieve the same effect.
403 args_cases = (1, "str", [1], (1,))
404 args_types = (list, tuple)
405
406 test_cases = itertools.product(args_cases, args_types)
407
408 for args, args_type in test_cases:
409 with self.subTest(args=args, args_type=args_type):
410 q = self.Queue(1)
411 # pass a tuple or list as args
412 p = self.Process(target=self._test_args, args=args_type((q, args)))
413 p.daemon = True
414 p.start()
415 child_args = q.get()
416 self.assertEqual(child_args, args)
417 p.join()
418 close_queue(q)
419
420 @classmethod
421 def _test_args(cls, q, arg):

Callers

nothing calls this directly

Calls 8

getMethod · 0.95
close_queueFunction · 0.85
QueueMethod · 0.80
subTestMethod · 0.45
ProcessMethod · 0.45
startMethod · 0.45
assertEqualMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected