def METHOD_NAME(tmpdir, show_duplicates, expected_tests_num):
    with tmpdir.join('test_file.py').open('w') as f:
        _print = functools.partial(print, file=f)
        _print('def test_function():')
        _print('    pass')
    with tmpdir.join('suitefile').open('w') as suite_file:
        _print = functools.partial(print, file=suite_file)
        _print('{}:test_function{}'.format(f.name, ''))
        _print('{}:test_function{}'.format(f.name, ''))
    args = ['-f', suite_file.name, '--only-tests']
    if show_duplicates:
        args.append('--show-duplicates')
    report_stream = StringIO()
    result = _slash_list(args, report_stream=report_stream)
    assert result == 0
    returned_tests = report_stream.getvalue().splitlines()
    assert len(returned_tests) == expected_tests_num
    assert set(returned_tests) == {'{}:test_function'.format(f.name)}