import pytest

import spacy


@pytest.mark.models
def test_not_lemmatize_base_forms():
    nlp = spacy.load('en', parser=False)
    doc = nlp(u"Don't feed the dog")
    feed = doc[2]
    feed.tag_ = u'VB'
    assert feed.text == u'feed'
    assert feed.lemma_ == u'feed'


from __future__ import unicode_literals
import pytest

from ...symbols import POS, VERB, VerbForm_inf
from ...tokens import Doc
from ...vocab import Vocab
from ...lemmatizer import Lemmatizer


@pytest.fixture
def index():
    return {'verb': {}}

@pytest.fixture
def exceptions():
    return {'verb': {}}

@pytest.fixture
def rules():
    return {"verb": [["ed", "e"]]}

@pytest.fixture
def lemmatizer(index, exceptions, rules):
    return Lemmatizer(index, exceptions, rules)


@pytest.fixture
def tag_map():
    return {'VB': {POS: VERB, 'morph': VerbForm_inf}}


@pytest.fixture
def vocab(lemmatizer, tag_map):
    return Vocab(lemmatizer=lemmatizer, tag_map=tag_map)


def test_not_lemmatize_base_forms(vocab, lemmatizer):
    doc = Doc(vocab, words=["Do", "n't", "feed", "the", "dog"])
    feed = doc[2]
    feed.tag_ = u'VB'
    assert feed.text == u'feed'
    assert feed.lemma_ == u'feed'


Change test595 to mock data, instead of requiring model.
Change test595 to mock data, instead of requiring model.

+ from __future__ import unicode_literals
  import pytest
  
- import spacy
+ from ...symbols import POS, VERB, VerbForm_inf
+ from ...tokens import Doc
+ from ...vocab import Vocab
+ from ...lemmatizer import Lemmatizer
  
  
- @pytest.mark.models
+ @pytest.fixture
+ def index():
+     return {'verb': {}}
+ 
+ @pytest.fixture
+ def exceptions():
+     return {'verb': {}}
+ 
+ @pytest.fixture
+ def rules():
+     return {"verb": [["ed", "e"]]}
+ 
+ @pytest.fixture
+ def lemmatizer(index, exceptions, rules):
+     return Lemmatizer(index, exceptions, rules)
+ 
+ 
+ @pytest.fixture
+ def tag_map():
+     return {'VB': {POS: VERB, 'morph': VerbForm_inf}}
+ 
+ 
+ @pytest.fixture
+ def vocab(lemmatizer, tag_map):
+     return Vocab(lemmatizer=lemmatizer, tag_map=tag_map)
+ 
+ 
- def test_not_lemmatize_base_forms():
+ def test_not_lemmatize_base_forms(vocab, lemmatizer):
+     doc = Doc(vocab, words=["Do", "n't", "feed", "the", "dog"])
-     nlp = spacy.load('en', parser=False)
-     doc = nlp(u"Don't feed the dog")
      feed = doc[2]
      feed.tag_ = u'VB'
      assert feed.text == u'feed'
      assert feed.lemma_ == u'feed'
  
  
Change test595 to mock data, instead of requiring model.
## Code Before:
import pytest

import spacy


@pytest.mark.models
def test_not_lemmatize_base_forms():
    nlp = spacy.load('en', parser=False)
    doc = nlp(u"Don't feed the dog")
    feed = doc[2]
    feed.tag_ = u'VB'
    assert feed.text == u'feed'
    assert feed.lemma_ == u'feed'


## Instruction:
Change test595 to mock data, instead of requiring model.
## Code After:
from __future__ import unicode_literals
import pytest

from ...symbols import POS, VERB, VerbForm_inf
from ...tokens import Doc
from ...vocab import Vocab
from ...lemmatizer import Lemmatizer


@pytest.fixture
def index():
    return {'verb': {}}

@pytest.fixture
def exceptions():
    return {'verb': {}}

@pytest.fixture
def rules():
    return {"verb": [["ed", "e"]]}

@pytest.fixture
def lemmatizer(index, exceptions, rules):
    return Lemmatizer(index, exceptions, rules)


@pytest.fixture
def tag_map():
    return {'VB': {POS: VERB, 'morph': VerbForm_inf}}


@pytest.fixture
def vocab(lemmatizer, tag_map):
    return Vocab(lemmatizer=lemmatizer, tag_map=tag_map)


def test_not_lemmatize_base_forms(vocab, lemmatizer):
    doc = Doc(vocab, words=["Do", "n't", "feed", "the", "dog"])
    feed = doc[2]
    feed.tag_ = u'VB'
    assert feed.text == u'feed'
    assert feed.lemma_ == u'feed'

