Replace CommonTestCases for tokenizers with a mixin.

This is the same change as for (TF)CommonTestCases for modeling.
This commit is contained in:
Aymeric Augustin
2019-12-22 15:34:15 +01:00
parent a3c5883f2c
commit 00204f2b4c
16 changed files with 412 additions and 411 deletions

View File

@@ -15,17 +15,18 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import unittest
from transformers.tokenization_xlnet import SPIECE_UNDERLINE, XLNetTokenizer
from .test_tokenization_commo import CommonTestCases
from .test_tokenization_common import TokenizerTesterMixin
from .utils import slow
SAMPLE_VOCAB = os.path.join(os.path.dirname(os.path.abspath(__file__)), "fixtures/test_sentencepiece.model")
class XLNetTokenizationTest(CommonTestCases.CommonTokenizerTester):
class XLNetTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
tokenizer_class = XLNetTokenizer