              parser.addoption("--%s" % model, action="store_true", help="Use %s model" % model)
  
  
  def pytest_runtest_setup(item):
      for opt in ['models', 'vectors', 'slow']:
          if opt in item.keywords and not getopt(opt):
              pytest.skip("need --%s option to run" % opt)
  
      # Check if test is marked with models and has arguments set, i.e. specific
 
</s> remove             if not item.config.getoption("--%s" % arg) and not item.config.getoption("--all"):
 </s> add             if not getopt(arg) and not getopt("all"): </s> remove         if opt in item.keywords and not item.config.getoption("--%s" % opt):
 </s> add         if opt in item.keywords and not getopt(opt):
    def getopt(opt):
        # When using 'pytest --pyargs spacy' to test an installed copy of
        # spacy, pytest skips running our pytest_addoption() hook. Later, when
        # we call getoption(), pytest raises an error, because it doesn't
        # recognize the option we're asking about. To avoid this, we need to
        # pass a default value. We default to False, i.e., we act like all the
        # options weren't given.
        return item.config.getoption("--%s" % opt, False)

              parser.addoption("--%s" % model, action="store_true", help="Use %s model" % model)
  
  
  def pytest_runtest_setup(item):
    def getopt(opt):
        # When using 'pytest --pyargs spacy' to test an installed copy of
        # spacy, pytest skips running our pytest_addoption() hook. Later, when
        # we call getoption(), pytest raises an error, because it doesn't
        # recognize the option we're asking about. To avoid this, we need to
        # pass a default value. We default to False, i.e., we act like all the
        # options weren't given.
        return item.config.getoption("--%s" % opt, False)

      for opt in ['models', 'vectors', 'slow']:
          if opt in item.keywords and not getopt(opt):
              pytest.skip("need --%s option to run" % opt)
  
      # Check if test is marked with models and has arguments set, i.e. specific
keep keep keep add keep keep keep keep keep
 When calling getoption() in conftest.py, pass a default option (#2709)

* When calling getoption() in conftest.py, pass a default option

This is necessary to allow testing an installed spacy by running:

  pytest --pyargs spacy

* Add contributor agreement 
spacy/tests/conftest.py