Switch test files to the standard test_*.py scheme.
This commit is contained in:
@@ -58,7 +58,7 @@ jobs:
|
|||||||
- run: sudo pip install --progress-bar off .
|
- run: sudo pip install --progress-bar off .
|
||||||
- run: sudo pip install pytest pytest-xdist
|
- run: sudo pip install pytest pytest-xdist
|
||||||
- run: sudo pip install mecab-python3
|
- run: sudo pip install mecab-python3
|
||||||
- run: RUN_CUSTOM_TOKENIZERS=1 python -m pytest -sv ./tests/tokenization_bert_japanese_test.py
|
- run: RUN_CUSTOM_TOKENIZERS=1 python -m pytest -sv ./tests/test_tokenization_bert_japanese.py
|
||||||
run_examples_py3_torch:
|
run_examples_py3_torch:
|
||||||
working_directory: ~/transformers
|
working_directory: ~/transformers
|
||||||
docker:
|
docker:
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ Depending on which framework is installed (TensorFlow 2.0 and/or PyTorch), the i
|
|||||||
You can run the tests from the root of the cloned repository with the commands:
|
You can run the tests from the root of the cloned repository with the commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python -m unittest discover -s tests -p "*test.py" -t .
|
python -m unittest -v discover -s tests -t . -v
|
||||||
python -m unittest discover -s examples -p "*test.py" -t examples
|
python -m unittest -v discover -s examples -t examples -v
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ Tests can be run using `unittest` or `pytest` (install pytest if needed with `pi
|
|||||||
Run all the tests from the root of the cloned repository with the commands:
|
Run all the tests from the root of the cloned repository with the commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python -m unittest discover -s tests -p "*test.py" -t .
|
python -m unittest discover -s tests -t . -v
|
||||||
python -m unittest discover -s examples -p "*test.py" -t examples
|
python -m unittest discover -s examples -t examples -v
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import XxxConfig, is_tf_available
|
from transformers import XxxConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, floats_tensor, ids_tensor
|
from .test_modeling_common import CommonTestCases, floats_tensor, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -17,8 +17,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import require_torch, torch_device
|
from .utils import require_torch, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow
|
from .utils import CACHE_DIR, require_torch, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import AlbertConfig, is_tf_available
|
from transformers import AlbertConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import BertConfig, is_tf_available
|
from transformers import BertConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import CTRLConfig, is_tf_available
|
from transformers import CTRLConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import DistilBertConfig, is_tf_available
|
from transformers import DistilBertConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import require_tf
|
from .utils import require_tf
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import GPT2Config, is_tf_available
|
from transformers import GPT2Config, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import OpenAIGPTConfig, is_tf_available
|
from transformers import OpenAIGPTConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import RobertaConfig, is_tf_available
|
from transformers import RobertaConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import T5Config, is_tf_available
|
from transformers import T5Config, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import TransfoXLConfig, is_tf_available
|
from transformers import TransfoXLConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_tf_available
|
from transformers import is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import XLNetConfig, is_tf_available
|
from transformers import XLNetConfig, is_tf_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_tf_common_test import TFCommonTestCases, ids_tensor
|
from .test_modeling_tf_common import TFCommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_tf, slow
|
from .utils import CACHE_DIR, require_tf, slow
|
||||||
|
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ import unittest
|
|||||||
|
|
||||||
from transformers import is_torch_available
|
from transformers import is_torch_available
|
||||||
|
|
||||||
from .configuration_common_test import ConfigTester
|
from .test_configuration_common import ConfigTester
|
||||||
from .modeling_common_test import CommonTestCases, ids_tensor
|
from .test_modeling_common import CommonTestCases, ids_tensor
|
||||||
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
from .utils import CACHE_DIR, require_torch, slow, torch_device
|
||||||
|
|
||||||
|
|
||||||
@@ -2,7 +2,8 @@ import unittest
|
|||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from transformers import pipeline
|
from transformers import pipeline
|
||||||
from transformers.tests.utils import require_tf, require_torch
|
|
||||||
|
from .utils import require_tf, require_torch
|
||||||
|
|
||||||
|
|
||||||
QA_FINETUNED_MODELS = {
|
QA_FINETUNED_MODELS = {
|
||||||
@@ -18,7 +18,7 @@ import unittest
|
|||||||
|
|
||||||
from transformers.tokenization_distilbert import DistilBertTokenizer
|
from transformers.tokenization_distilbert import DistilBertTokenizer
|
||||||
|
|
||||||
from .tokenization_bert_test import BertTokenizationTest
|
from .test_tokenization_bert import BertTokenizationTest
|
||||||
from .utils import slow
|
from .utils import slow
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user