import pytest
import os

import spacy


@pytest.fixture(scope="session")
def EN():
    return spacy.load("en")

@pytest.fixture(scope="session")
def DE():
    return spacy.load("de")


def pytest_addoption(parser):
    parser.addoption("--models", action="store_true",
        help="include tests that require full models")
    parser.addoption("--vectors", action="store_true",
        help="include word vectors tests")
    parser.addoption("--slow", action="store_true",
        help="include slow tests")


def pytest_runtest_setup(item):
    for opt in ['models', 'vectors', 'slow']:
        if opt in item.keywords and not item.config.getoption("--%s" % opt):
            pytest.skip("need --%s option to run" % opt)

import pytest
import os

from ..en import English
from ..de import German


@pytest.fixture(scope="session")
def EN():
    return English(path=None)

@pytest.fixture(scope="session")
def DE():
    return German(path=None)


def pytest_addoption(parser):
    parser.addoption("--models", action="store_true",
        help="include tests that require full models")
    parser.addoption("--vectors", action="store_true",
        help="include word vectors tests")
    parser.addoption("--slow", action="store_true",
        help="include slow tests")


def pytest_runtest_setup(item):
    for opt in ['models', 'vectors', 'slow']:
        if opt in item.keywords and not item.config.getoption("--%s" % opt):
            pytest.skip("need --%s option to run" % opt)

Test with the non-loaded versions of the English and German pipelines.
Test with the non-loaded versions of the English and German pipelines.

  import pytest
  import os
  
- import spacy
+ from ..en import English
+ from ..de import German
  
  
  @pytest.fixture(scope="session")
  def EN():
-     return spacy.load("en")
+     return English(path=None)
  
  @pytest.fixture(scope="session")
  def DE():
-     return spacy.load("de")
+     return German(path=None)
  
  
  def pytest_addoption(parser):
      parser.addoption("--models", action="store_true",
          help="include tests that require full models")
      parser.addoption("--vectors", action="store_true",
          help="include word vectors tests")
      parser.addoption("--slow", action="store_true",
          help="include slow tests")
  
  
  def pytest_runtest_setup(item):
      for opt in ['models', 'vectors', 'slow']:
          if opt in item.keywords and not item.config.getoption("--%s" % opt):
              pytest.skip("need --%s option to run" % opt)
  
Test with the non-loaded versions of the English and German pipelines.
## Code Before:
import pytest
import os

import spacy


@pytest.fixture(scope="session")
def EN():
    return spacy.load("en")

@pytest.fixture(scope="session")
def DE():
    return spacy.load("de")


def pytest_addoption(parser):
    parser.addoption("--models", action="store_true",
        help="include tests that require full models")
    parser.addoption("--vectors", action="store_true",
        help="include word vectors tests")
    parser.addoption("--slow", action="store_true",
        help="include slow tests")


def pytest_runtest_setup(item):
    for opt in ['models', 'vectors', 'slow']:
        if opt in item.keywords and not item.config.getoption("--%s" % opt):
            pytest.skip("need --%s option to run" % opt)

## Instruction:
Test with the non-loaded versions of the English and German pipelines.
## Code After:
import pytest
import os

from ..en import English
from ..de import German


@pytest.fixture(scope="session")
def EN():
    return English(path=None)

@pytest.fixture(scope="session")
def DE():
    return German(path=None)


def pytest_addoption(parser):
    parser.addoption("--models", action="store_true",
        help="include tests that require full models")
    parser.addoption("--vectors", action="store_true",
        help="include word vectors tests")
    parser.addoption("--slow", action="store_true",
        help="include slow tests")


def pytest_runtest_setup(item):
    for opt in ['models', 'vectors', 'slow']:
        if opt in item.keywords and not item.config.getoption("--%s" % opt):
            pytest.skip("need --%s option to run" % opt)
