From ced0a9420412ca58ba8f96c0532b61fd1df9061f Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 22 Dec 2019 13:44:13 +0100 Subject: [PATCH] Switch test files to the standard test_*.py scheme. --- .circleci/config.yml | 2 +- README.md | 4 ++-- docs/source/installation.md | 4 ++-- ...tils_summarization_test.py => test_utils_summarization.py} | 0 .../{modeling_tf_xxx_test.py => test_modeling_tf_xxx.py} | 4 ++-- .../tests/{modeling_xxx_test.py => test_modeling_xxx.py} | 4 ++-- .../{tokenization_xxx_test.py => test_tokenization_xxx.py} | 0 ...figuration_common_test.py => test_configuration_common.py} | 0 tests/{hf_api_test.py => test_hf_api.py} | 0 tests/{model_card_test.py => test_model_card.py} | 0 tests/{modeling_albert_test.py => test_modeling_albert.py} | 4 ++-- tests/{modeling_auto_test.py => test_modeling_auto.py} | 0 tests/{modeling_bert_test.py => test_modeling_bert.py} | 4 ++-- tests/{modeling_common_test.py => test_modeling_common.py} | 0 tests/{modeling_ctrl_test.py => test_modeling_ctrl.py} | 4 ++-- ...odeling_distilbert_test.py => test_modeling_distilbert.py} | 4 ++-- ...coder_decoder_test.py => test_modeling_encoder_decoder.py} | 0 tests/{modeling_gpt2_test.py => test_modeling_gpt2.py} | 4 ++-- tests/{modeling_openai_test.py => test_modeling_openai.py} | 4 ++-- tests/{modeling_roberta_test.py => test_modeling_roberta.py} | 4 ++-- tests/{modeling_t5_test.py => test_modeling_t5.py} | 4 ++-- ...{modeling_tf_albert_test.py => test_modeling_tf_albert.py} | 4 ++-- tests/{modeling_tf_auto_test.py => test_modeling_tf_auto.py} | 0 tests/{modeling_tf_bert_test.py => test_modeling_tf_bert.py} | 4 ++-- ...{modeling_tf_common_test.py => test_modeling_tf_common.py} | 0 tests/{modeling_tf_ctrl_test.py => test_modeling_tf_ctrl.py} | 4 ++-- ...g_tf_distilbert_test.py => test_modeling_tf_distilbert.py} | 4 ++-- tests/{modeling_tf_gpt2_test.py => test_modeling_tf_gpt2.py} | 4 ++-- ...g_tf_openai_gpt_test.py => test_modeling_tf_openai_gpt.py} | 4 ++-- ...odeling_tf_roberta_test.py => test_modeling_tf_roberta.py} | 4 ++-- tests/{modeling_tf_t5_test.py => test_modeling_tf_t5.py} | 4 ++-- ...g_tf_transfo_xl_test.py => test_modeling_tf_transfo_xl.py} | 4 ++-- tests/{modeling_tf_xlm_test.py => test_modeling_tf_xlm.py} | 4 ++-- .../{modeling_tf_xlnet_test.py => test_modeling_tf_xlnet.py} | 4 ++-- ...odeling_transfo_xl_test.py => test_modeling_transfo_xl.py} | 4 ++-- tests/{modeling_xlm_test.py => test_modeling_xlm.py} | 4 ++-- tests/{modeling_xlnet_test.py => test_modeling_xlnet.py} | 4 ++-- tests/{optimization_test.py => test_optimization.py} | 0 tests/{optimization_tf_test.py => test_optimization_tf.py} | 0 tests/{pipelines_test.py => test_pipelines.py} | 3 ++- ...okenization_albert_test.py => test_tokenization_albert.py} | 0 .../{tokenization_auto_test.py => test_tokenization_auto.py} | 0 .../{tokenization_bert_test.py => test_tokenization_bert.py} | 0 ...rt_japanese_test.py => test_tokenization_bert_japanese.py} | 0 .../{tokenization_ctrl_test.py => test_tokenization_ctrl.py} | 0 ...ion_distilbert_test.py => test_tokenization_distilbert.py} | 2 +- .../{tokenization_gpt2_test.py => test_tokenization_gpt2.py} | 0 ...okenization_openai_test.py => test_tokenization_openai.py} | 0 ...enization_roberta_test.py => test_tokenization_roberta.py} | 0 tests/{tokenization_t5_test.py => test_tokenization_t5.py} | 0 ...ion_transfo_xl_test.py => test_tokenization_transfo_xl.py} | 0 ...{tokenization_utils_test.py => test_tokenization_utils.py} | 0 tests/{tokenization_xlm_test.py => test_tokenization_xlm.py} | 0 ...{tokenization_xlnet_test.py => test_tokenization_xlnet.py} | 0 54 files changed, 56 insertions(+), 55 deletions(-) rename examples/summarization/{utils_summarization_test.py => test_utils_summarization.py} (100%) rename templates/adding_a_new_model/tests/{modeling_tf_xxx_test.py => test_modeling_tf_xxx.py} (98%) rename templates/adding_a_new_model/tests/{modeling_xxx_test.py => test_modeling_xxx.py} (99%) rename templates/adding_a_new_model/tests/{tokenization_xxx_test.py => test_tokenization_xxx.py} (100%) rename tests/{configuration_common_test.py => test_configuration_common.py} (100%) rename tests/{hf_api_test.py => test_hf_api.py} (100%) rename tests/{model_card_test.py => test_model_card.py} (100%) rename tests/{modeling_albert_test.py => test_modeling_albert.py} (98%) rename tests/{modeling_auto_test.py => test_modeling_auto.py} (100%) rename tests/{modeling_bert_test.py => test_modeling_bert.py} (99%) rename tests/{modeling_common_test.py => test_modeling_common.py} (100%) rename tests/{modeling_ctrl_test.py => test_modeling_ctrl.py} (98%) rename tests/{modeling_distilbert_test.py => test_modeling_distilbert.py} (98%) rename tests/{modeling_encoder_decoder_test.py => test_modeling_encoder_decoder.py} (100%) rename tests/{modeling_gpt2_test.py => test_modeling_gpt2.py} (98%) rename tests/{modeling_openai_test.py => test_modeling_openai.py} (98%) rename tests/{modeling_roberta_test.py => test_modeling_roberta.py} (99%) rename tests/{modeling_t5_test.py => test_modeling_t5.py} (98%) rename tests/{modeling_tf_albert_test.py => test_modeling_tf_albert.py} (98%) rename tests/{modeling_tf_auto_test.py => test_modeling_tf_auto.py} (100%) rename tests/{modeling_tf_bert_test.py => test_modeling_tf_bert.py} (99%) rename tests/{modeling_tf_common_test.py => test_modeling_tf_common.py} (100%) rename tests/{modeling_tf_ctrl_test.py => test_modeling_tf_ctrl.py} (98%) rename tests/{modeling_tf_distilbert_test.py => test_modeling_tf_distilbert.py} (98%) rename tests/{modeling_tf_gpt2_test.py => test_modeling_tf_gpt2.py} (98%) rename tests/{modeling_tf_openai_gpt_test.py => test_modeling_tf_openai_gpt.py} (98%) rename tests/{modeling_tf_roberta_test.py => test_modeling_tf_roberta.py} (98%) rename tests/{modeling_tf_t5_test.py => test_modeling_tf_t5.py} (98%) rename tests/{modeling_tf_transfo_xl_test.py => test_modeling_tf_transfo_xl.py} (98%) rename tests/{modeling_tf_xlm_test.py => test_modeling_tf_xlm.py} (98%) rename tests/{modeling_tf_xlnet_test.py => test_modeling_tf_xlnet.py} (99%) rename tests/{modeling_transfo_xl_test.py => test_modeling_transfo_xl.py} (98%) rename tests/{modeling_xlm_test.py => test_modeling_xlm.py} (99%) rename tests/{modeling_xlnet_test.py => test_modeling_xlnet.py} (99%) rename tests/{optimization_test.py => test_optimization.py} (100%) rename tests/{optimization_tf_test.py => test_optimization_tf.py} (100%) rename tests/{pipelines_test.py => test_pipelines.py} (99%) rename tests/{tokenization_albert_test.py => test_tokenization_albert.py} (100%) rename tests/{tokenization_auto_test.py => test_tokenization_auto.py} (100%) rename tests/{tokenization_bert_test.py => test_tokenization_bert.py} (100%) rename tests/{tokenization_bert_japanese_test.py => test_tokenization_bert_japanese.py} (100%) rename tests/{tokenization_ctrl_test.py => test_tokenization_ctrl.py} (100%) rename tests/{tokenization_distilbert_test.py => test_tokenization_distilbert.py} (96%) rename tests/{tokenization_gpt2_test.py => test_tokenization_gpt2.py} (100%) rename tests/{tokenization_openai_test.py => test_tokenization_openai.py} (100%) rename tests/{tokenization_roberta_test.py => test_tokenization_roberta.py} (100%) rename tests/{tokenization_t5_test.py => test_tokenization_t5.py} (100%) rename tests/{tokenization_transfo_xl_test.py => test_tokenization_transfo_xl.py} (100%) rename tests/{tokenization_utils_test.py => test_tokenization_utils.py} (100%) rename tests/{tokenization_xlm_test.py => test_tokenization_xlm.py} (100%) rename tests/{tokenization_xlnet_test.py => test_tokenization_xlnet.py} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index d32faae8e9..9cc18139b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: - run: sudo pip install --progress-bar off . - run: sudo pip install pytest pytest-xdist - 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: working_directory: ~/transformers docker: diff --git a/README.md b/README.md index fcfb6dc9b5..22db72f989 100644 --- a/README.md +++ b/README.md @@ -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: ```bash -python -m unittest discover -s tests -p "*test.py" -t . -python -m unittest discover -s examples -p "*test.py" -t examples +python -m unittest -v discover -s tests -t . -v +python -m unittest -v discover -s examples -t examples -v ``` or diff --git a/docs/source/installation.md b/docs/source/installation.md index 5c901d122e..b4281c3445 100644 --- a/docs/source/installation.md +++ b/docs/source/installation.md @@ -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: ```bash -python -m unittest discover -s tests -p "*test.py" -t . -python -m unittest discover -s examples -p "*test.py" -t examples +python -m unittest discover -s tests -t . -v +python -m unittest discover -s examples -t examples -v ``` or diff --git a/examples/summarization/utils_summarization_test.py b/examples/summarization/test_utils_summarization.py similarity index 100% rename from examples/summarization/utils_summarization_test.py rename to examples/summarization/test_utils_summarization.py diff --git a/templates/adding_a_new_model/tests/modeling_tf_xxx_test.py b/templates/adding_a_new_model/tests/test_modeling_tf_xxx.py similarity index 98% rename from templates/adding_a_new_model/tests/modeling_tf_xxx_test.py rename to templates/adding_a_new_model/tests/test_modeling_tf_xxx.py index cb0898488a..8879c7e7d1 100644 --- a/templates/adding_a_new_model/tests/modeling_tf_xxx_test.py +++ b/templates/adding_a_new_model/tests/test_modeling_tf_xxx.py @@ -18,8 +18,8 @@ import unittest from transformers import XxxConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/templates/adding_a_new_model/tests/modeling_xxx_test.py b/templates/adding_a_new_model/tests/test_modeling_xxx.py similarity index 99% rename from templates/adding_a_new_model/tests/modeling_xxx_test.py rename to templates/adding_a_new_model/tests/test_modeling_xxx.py index 1c9baa44f3..e49b8e435b 100644 --- a/templates/adding_a_new_model/tests/modeling_xxx_test.py +++ b/templates/adding_a_new_model/tests/test_modeling_xxx.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/templates/adding_a_new_model/tests/tokenization_xxx_test.py b/templates/adding_a_new_model/tests/test_tokenization_xxx.py similarity index 100% rename from templates/adding_a_new_model/tests/tokenization_xxx_test.py rename to templates/adding_a_new_model/tests/test_tokenization_xxx.py diff --git a/tests/configuration_common_test.py b/tests/test_configuration_common.py similarity index 100% rename from tests/configuration_common_test.py rename to tests/test_configuration_common.py diff --git a/tests/hf_api_test.py b/tests/test_hf_api.py similarity index 100% rename from tests/hf_api_test.py rename to tests/test_hf_api.py diff --git a/tests/model_card_test.py b/tests/test_model_card.py similarity index 100% rename from tests/model_card_test.py rename to tests/test_model_card.py diff --git a/tests/modeling_albert_test.py b/tests/test_modeling_albert.py similarity index 98% rename from tests/modeling_albert_test.py rename to tests/test_modeling_albert.py index b2a0abe1f1..d0d85e670a 100644 --- a/tests/modeling_albert_test.py +++ b/tests/test_modeling_albert.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/modeling_auto_test.py b/tests/test_modeling_auto.py similarity index 100% rename from tests/modeling_auto_test.py rename to tests/test_modeling_auto.py diff --git a/tests/modeling_bert_test.py b/tests/test_modeling_bert.py similarity index 99% rename from tests/modeling_bert_test.py rename to tests/test_modeling_bert.py index f7325eff9e..f96993bb50 100644 --- a/tests/modeling_bert_test.py +++ b/tests/test_modeling_bert.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, floats_tensor, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, floats_tensor, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/modeling_common_test.py b/tests/test_modeling_common.py similarity index 100% rename from tests/modeling_common_test.py rename to tests/test_modeling_common.py diff --git a/tests/modeling_ctrl_test.py b/tests/test_modeling_ctrl.py similarity index 98% rename from tests/modeling_ctrl_test.py rename to tests/test_modeling_ctrl.py index b6b52dd0b7..7d2d2e12b6 100644 --- a/tests/modeling_ctrl_test.py +++ b/tests/test_modeling_ctrl.py @@ -17,8 +17,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/modeling_distilbert_test.py b/tests/test_modeling_distilbert.py similarity index 98% rename from tests/modeling_distilbert_test.py rename to tests/test_modeling_distilbert.py index 1044f15ee5..e432761c1b 100644 --- a/tests/modeling_distilbert_test.py +++ b/tests/test_modeling_distilbert.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import require_torch, torch_device diff --git a/tests/modeling_encoder_decoder_test.py b/tests/test_modeling_encoder_decoder.py similarity index 100% rename from tests/modeling_encoder_decoder_test.py rename to tests/test_modeling_encoder_decoder.py diff --git a/tests/modeling_gpt2_test.py b/tests/test_modeling_gpt2.py similarity index 98% rename from tests/modeling_gpt2_test.py rename to tests/test_modeling_gpt2.py index 82ace85291..daa6ed9269 100644 --- a/tests/modeling_gpt2_test.py +++ b/tests/test_modeling_gpt2.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/modeling_openai_test.py b/tests/test_modeling_openai.py similarity index 98% rename from tests/modeling_openai_test.py rename to tests/test_modeling_openai.py index 21ea556ac4..1fd198577a 100644 --- a/tests/modeling_openai_test.py +++ b/tests/test_modeling_openai.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/modeling_roberta_test.py b/tests/test_modeling_roberta.py similarity index 99% rename from tests/modeling_roberta_test.py rename to tests/test_modeling_roberta.py index e6909deae2..2141082e4d 100644 --- a/tests/modeling_roberta_test.py +++ b/tests/test_modeling_roberta.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/modeling_t5_test.py b/tests/test_modeling_t5.py similarity index 98% rename from tests/modeling_t5_test.py rename to tests/test_modeling_t5.py index 460037ea33..76286dbd36 100644 --- a/tests/modeling_t5_test.py +++ b/tests/test_modeling_t5.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow diff --git a/tests/modeling_tf_albert_test.py b/tests/test_modeling_tf_albert.py similarity index 98% rename from tests/modeling_tf_albert_test.py rename to tests/test_modeling_tf_albert.py index a34f4b3813..0a569a467c 100644 --- a/tests/modeling_tf_albert_test.py +++ b/tests/test_modeling_tf_albert.py @@ -18,8 +18,8 @@ import unittest from transformers import AlbertConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_auto_test.py b/tests/test_modeling_tf_auto.py similarity index 100% rename from tests/modeling_tf_auto_test.py rename to tests/test_modeling_tf_auto.py diff --git a/tests/modeling_tf_bert_test.py b/tests/test_modeling_tf_bert.py similarity index 99% rename from tests/modeling_tf_bert_test.py rename to tests/test_modeling_tf_bert.py index e07ef4f2bc..cce488cf0e 100644 --- a/tests/modeling_tf_bert_test.py +++ b/tests/test_modeling_tf_bert.py @@ -18,8 +18,8 @@ import unittest from transformers import BertConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_common_test.py b/tests/test_modeling_tf_common.py similarity index 100% rename from tests/modeling_tf_common_test.py rename to tests/test_modeling_tf_common.py diff --git a/tests/modeling_tf_ctrl_test.py b/tests/test_modeling_tf_ctrl.py similarity index 98% rename from tests/modeling_tf_ctrl_test.py rename to tests/test_modeling_tf_ctrl.py index dad072cd3b..763a6adb58 100644 --- a/tests/modeling_tf_ctrl_test.py +++ b/tests/test_modeling_tf_ctrl.py @@ -18,8 +18,8 @@ import unittest from transformers import CTRLConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_distilbert_test.py b/tests/test_modeling_tf_distilbert.py similarity index 98% rename from tests/modeling_tf_distilbert_test.py rename to tests/test_modeling_tf_distilbert.py index 5b343c09a0..e82436c026 100644 --- a/tests/modeling_tf_distilbert_test.py +++ b/tests/test_modeling_tf_distilbert.py @@ -18,8 +18,8 @@ import unittest from transformers import DistilBertConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import require_tf diff --git a/tests/modeling_tf_gpt2_test.py b/tests/test_modeling_tf_gpt2.py similarity index 98% rename from tests/modeling_tf_gpt2_test.py rename to tests/test_modeling_tf_gpt2.py index e93399a27f..c7e2334572 100644 --- a/tests/modeling_tf_gpt2_test.py +++ b/tests/test_modeling_tf_gpt2.py @@ -18,8 +18,8 @@ import unittest from transformers import GPT2Config, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_openai_gpt_test.py b/tests/test_modeling_tf_openai_gpt.py similarity index 98% rename from tests/modeling_tf_openai_gpt_test.py rename to tests/test_modeling_tf_openai_gpt.py index 801cf23e1c..5d4c7905a9 100644 --- a/tests/modeling_tf_openai_gpt_test.py +++ b/tests/test_modeling_tf_openai_gpt.py @@ -18,8 +18,8 @@ import unittest from transformers import OpenAIGPTConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_roberta_test.py b/tests/test_modeling_tf_roberta.py similarity index 98% rename from tests/modeling_tf_roberta_test.py rename to tests/test_modeling_tf_roberta.py index 3b9f1961b8..6369b1d6f5 100644 --- a/tests/modeling_tf_roberta_test.py +++ b/tests/test_modeling_tf_roberta.py @@ -18,8 +18,8 @@ import unittest from transformers import RobertaConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_t5_test.py b/tests/test_modeling_tf_t5.py similarity index 98% rename from tests/modeling_tf_t5_test.py rename to tests/test_modeling_tf_t5.py index 84919bf43c..0d2ccfe140 100644 --- a/tests/modeling_tf_t5_test.py +++ b/tests/test_modeling_tf_t5.py @@ -18,8 +18,8 @@ import unittest from transformers import T5Config, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_transfo_xl_test.py b/tests/test_modeling_tf_transfo_xl.py similarity index 98% rename from tests/modeling_tf_transfo_xl_test.py rename to tests/test_modeling_tf_transfo_xl.py index 2b17668a94..ed5753c11d 100644 --- a/tests/modeling_tf_transfo_xl_test.py +++ b/tests/test_modeling_tf_transfo_xl.py @@ -19,8 +19,8 @@ import unittest from transformers import TransfoXLConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_xlm_test.py b/tests/test_modeling_tf_xlm.py similarity index 98% rename from tests/modeling_tf_xlm_test.py rename to tests/test_modeling_tf_xlm.py index 0850cecb07..40a06ccfa4 100644 --- a/tests/modeling_tf_xlm_test.py +++ b/tests/test_modeling_tf_xlm.py @@ -18,8 +18,8 @@ import unittest from transformers import is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_tf_xlnet_test.py b/tests/test_modeling_tf_xlnet.py similarity index 99% rename from tests/modeling_tf_xlnet_test.py rename to tests/test_modeling_tf_xlnet.py index 0e0c70ed52..c3456787dd 100644 --- a/tests/modeling_tf_xlnet_test.py +++ b/tests/test_modeling_tf_xlnet.py @@ -19,8 +19,8 @@ import unittest from transformers import XLNetConfig, is_tf_available -from .configuration_common_test import ConfigTester -from .modeling_tf_common_test import TFCommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_tf_common import TFCommonTestCases, ids_tensor from .utils import CACHE_DIR, require_tf, slow diff --git a/tests/modeling_transfo_xl_test.py b/tests/test_modeling_transfo_xl.py similarity index 98% rename from tests/modeling_transfo_xl_test.py rename to tests/test_modeling_transfo_xl.py index 4289483a89..8465f351db 100644 --- a/tests/modeling_transfo_xl_test.py +++ b/tests/test_modeling_transfo_xl.py @@ -19,8 +19,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/modeling_xlm_test.py b/tests/test_modeling_xlm.py similarity index 99% rename from tests/modeling_xlm_test.py rename to tests/test_modeling_xlm.py index a0cc8e69f0..8ac3b5050a 100644 --- a/tests/modeling_xlm_test.py +++ b/tests/test_modeling_xlm.py @@ -18,8 +18,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/modeling_xlnet_test.py b/tests/test_modeling_xlnet.py similarity index 99% rename from tests/modeling_xlnet_test.py rename to tests/test_modeling_xlnet.py index decd7f0f41..0ba7dd23b5 100644 --- a/tests/modeling_xlnet_test.py +++ b/tests/test_modeling_xlnet.py @@ -19,8 +19,8 @@ import unittest from transformers import is_torch_available -from .configuration_common_test import ConfigTester -from .modeling_common_test import CommonTestCases, ids_tensor +from .test_configuration_common import ConfigTester +from .test_modeling_common import CommonTestCases, ids_tensor from .utils import CACHE_DIR, require_torch, slow, torch_device diff --git a/tests/optimization_test.py b/tests/test_optimization.py similarity index 100% rename from tests/optimization_test.py rename to tests/test_optimization.py diff --git a/tests/optimization_tf_test.py b/tests/test_optimization_tf.py similarity index 100% rename from tests/optimization_tf_test.py rename to tests/test_optimization_tf.py diff --git a/tests/pipelines_test.py b/tests/test_pipelines.py similarity index 99% rename from tests/pipelines_test.py rename to tests/test_pipelines.py index 2dfbdaaa05..6f3ea19c7b 100644 --- a/tests/pipelines_test.py +++ b/tests/test_pipelines.py @@ -2,7 +2,8 @@ import unittest from typing import Iterable from transformers import pipeline -from transformers.tests.utils import require_tf, require_torch + +from .utils import require_tf, require_torch QA_FINETUNED_MODELS = { diff --git a/tests/tokenization_albert_test.py b/tests/test_tokenization_albert.py similarity index 100% rename from tests/tokenization_albert_test.py rename to tests/test_tokenization_albert.py diff --git a/tests/tokenization_auto_test.py b/tests/test_tokenization_auto.py similarity index 100% rename from tests/tokenization_auto_test.py rename to tests/test_tokenization_auto.py diff --git a/tests/tokenization_bert_test.py b/tests/test_tokenization_bert.py similarity index 100% rename from tests/tokenization_bert_test.py rename to tests/test_tokenization_bert.py diff --git a/tests/tokenization_bert_japanese_test.py b/tests/test_tokenization_bert_japanese.py similarity index 100% rename from tests/tokenization_bert_japanese_test.py rename to tests/test_tokenization_bert_japanese.py diff --git a/tests/tokenization_ctrl_test.py b/tests/test_tokenization_ctrl.py similarity index 100% rename from tests/tokenization_ctrl_test.py rename to tests/test_tokenization_ctrl.py diff --git a/tests/tokenization_distilbert_test.py b/tests/test_tokenization_distilbert.py similarity index 96% rename from tests/tokenization_distilbert_test.py rename to tests/test_tokenization_distilbert.py index 3417fc76d5..cbaf546ddd 100644 --- a/tests/tokenization_distilbert_test.py +++ b/tests/test_tokenization_distilbert.py @@ -18,7 +18,7 @@ import unittest from transformers.tokenization_distilbert import DistilBertTokenizer -from .tokenization_bert_test import BertTokenizationTest +from .test_tokenization_bert import BertTokenizationTest from .utils import slow diff --git a/tests/tokenization_gpt2_test.py b/tests/test_tokenization_gpt2.py similarity index 100% rename from tests/tokenization_gpt2_test.py rename to tests/test_tokenization_gpt2.py diff --git a/tests/tokenization_openai_test.py b/tests/test_tokenization_openai.py similarity index 100% rename from tests/tokenization_openai_test.py rename to tests/test_tokenization_openai.py diff --git a/tests/tokenization_roberta_test.py b/tests/test_tokenization_roberta.py similarity index 100% rename from tests/tokenization_roberta_test.py rename to tests/test_tokenization_roberta.py diff --git a/tests/tokenization_t5_test.py b/tests/test_tokenization_t5.py similarity index 100% rename from tests/tokenization_t5_test.py rename to tests/test_tokenization_t5.py diff --git a/tests/tokenization_transfo_xl_test.py b/tests/test_tokenization_transfo_xl.py similarity index 100% rename from tests/tokenization_transfo_xl_test.py rename to tests/test_tokenization_transfo_xl.py diff --git a/tests/tokenization_utils_test.py b/tests/test_tokenization_utils.py similarity index 100% rename from tests/tokenization_utils_test.py rename to tests/test_tokenization_utils.py diff --git a/tests/tokenization_xlm_test.py b/tests/test_tokenization_xlm.py similarity index 100% rename from tests/tokenization_xlm_test.py rename to tests/test_tokenization_xlm.py diff --git a/tests/tokenization_xlnet_test.py b/tests/test_tokenization_xlnet.py similarity index 100% rename from tests/tokenization_xlnet_test.py rename to tests/test_tokenization_xlnet.py