def test_invalid_nargs(runner):
    try:
        @click.command()
        @click.option('--foo', nargs=-1)
        def cli(foo):
            pass
    except __HOLE__ as e:
        assert 'Options cannot have nargs < 0' 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_nargs