Code Duplication    Length = 11-11 lines in 2 locations

tests/test_manhole.py 2 locations

@@ 470-480 (lines=11) @@
467
            assert_manhole_running(proc, uds_path, oneshot=True,
468
                                   extra=lambda client: client.sock.send(b"raise SystemExit()\n"))
469
470
            proc.reset()
471
            proc.signal(signal.SIGUSR2)
472
            wait_for_strings(proc.read, TIMEOUT, '/tmp/manhole-')
473
            uds_path = re.findall(r"(/tmp/manhole-\d+)", proc.read())[0]
474
            wait_for_strings(proc.read, TIMEOUT, 'Waiting for new connection')
475
            assert_manhole_running(proc, uds_path, oneshot=True)
476
477
478
def test_interrupt_on_accept():
479
    with TestProcess(sys.executable, '-u', HELPER, 'test_interrupt_on_accept') as proc:
480
        with dump_on_error(proc.read):
481
            wait_for_strings(proc.read, TIMEOUT, '/tmp/manhole-')
482
            uds_path = re.findall(r"(/tmp/manhole-\d+)", proc.read())[0]
483
            only_on_old_python = ['Waiting for new connection'] if sys.version_info < (3, 5) else []
@@ 426-436 (lines=11) @@
423
424
def test_activate_on_usr2():
425
    with TestProcess(sys.executable, '-u', HELPER, 'test_activate_on_usr2') as proc:
426
        with dump_on_error(proc.read):
427
            wait_for_strings(proc.read, TIMEOUT, 'Not patching os.fork and os.forkpty. Activation is done by signal')
428
            raises(AssertionError, wait_for_strings, proc.read, TIMEOUT, '/tmp/manhole-')
429
            proc.signal(signal.SIGUSR2)
430
            wait_for_strings(proc.read, TIMEOUT, '/tmp/manhole-')
431
            uds_path = re.findall(r"(/tmp/manhole-\d+)", proc.read())[0]
432
            wait_for_strings(proc.read, TIMEOUT, 'Waiting for new connection')
433
            assert_manhole_running(proc, uds_path)
434
435
436
def test_activate_on_with_oneshot_on():
437
    with TestProcess(sys.executable, '-u', HELPER, 'test_activate_on_with_oneshot_on') as proc:
438
        with dump_on_error(proc.read):
439
            wait_for_strings(proc.read, TIMEOUT,