def check_argument_type(name, value):
    text = NamedTemporaryFile()

    try:
        with patch('sys.stderr') as mock_stderr:
            args = cli.parse_args(['--text', text.name, '--' + name, str(value)])
        raise AssertionError('argument "{}" was accepted even though the type did not match'.format(name))
    except SystemExit:
        pass
    except __HOLE__:
        pass
dataset/ETHPy150Open amueller/word_cloud/test/test_wordcloud_cli.py/check_argument_type