def test_invalid_option(runner):
    try:
        @click.command()
        @click.option('foo')
        def cli(foo):
            pass
    except __HOLE__ as e:
        assert 'No options defined but a name was passed (foo).' \
            in str(e)
    else:
        assert False, 'Expected a type error because of an invalid option.'
dataset/ETHPy150Open pallets/click/tests/test_options.py/test_invalid_option