MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_args_argument

Method test_args_argument

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

Source from the content-addressed store, hash-verified

342
343 @support.requires_resource('cpu')
344 def test_args_argument(self):
345 # bpo-45735: Using list or tuple as *args* in constructor could
346 # achieve the same effect.
347 args_cases = (1, "str", [1], (1,))
348 args_types = (list, tuple)
349
350 test_cases = itertools.product(args_cases, args_types)
351
352 for args, args_type in test_cases:
353 with self.subTest(args=args, args_type=args_type):
354 q = self.Queue(1)
355 # pass a tuple or list as args
356 p = self.Process(target=self._test_args, args=args_type((q, args)))
357 p.daemon = True
358 p.start()
359 child_args = q.get()
360 self.assertEqual(child_args, args)
361 p.join()
362 close_queue(q)
363
364 @classmethod
365 def _test_args(cls, q, arg):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected