(self)
| 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): |
nothing calls this directly
no test coverage detected