Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
ced0a942
Commit
ced0a942
authored
Dec 22, 2019
by
Aymeric Augustin
Browse files
Switch test files to the standard test_*.py scheme.
parent
067395d5
Changes
54
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
23 additions
and
23 deletions
+23
-23
.circleci/config.yml
.circleci/config.yml
+1
-1
README.md
README.md
+2
-2
docs/source/installation.md
docs/source/installation.md
+2
-2
examples/summarization/test_utils_summarization.py
examples/summarization/test_utils_summarization.py
+0
-0
templates/adding_a_new_model/tests/test_modeling_tf_xxx.py
templates/adding_a_new_model/tests/test_modeling_tf_xxx.py
+2
-2
templates/adding_a_new_model/tests/test_modeling_xxx.py
templates/adding_a_new_model/tests/test_modeling_xxx.py
+2
-2
templates/adding_a_new_model/tests/test_tokenization_xxx.py
templates/adding_a_new_model/tests/test_tokenization_xxx.py
+0
-0
tests/test_configuration_common.py
tests/test_configuration_common.py
+0
-0
tests/test_hf_api.py
tests/test_hf_api.py
+0
-0
tests/test_model_card.py
tests/test_model_card.py
+0
-0
tests/test_modeling_albert.py
tests/test_modeling_albert.py
+2
-2
tests/test_modeling_auto.py
tests/test_modeling_auto.py
+0
-0
tests/test_modeling_bert.py
tests/test_modeling_bert.py
+2
-2
tests/test_modeling_common.py
tests/test_modeling_common.py
+0
-0
tests/test_modeling_ctrl.py
tests/test_modeling_ctrl.py
+2
-2
tests/test_modeling_distilbert.py
tests/test_modeling_distilbert.py
+2
-2
tests/test_modeling_encoder_decoder.py
tests/test_modeling_encoder_decoder.py
+0
-0
tests/test_modeling_gpt2.py
tests/test_modeling_gpt2.py
+2
-2
tests/test_modeling_openai.py
tests/test_modeling_openai.py
+2
-2
tests/test_modeling_roberta.py
tests/test_modeling_roberta.py
+2
-2
No files found.
.circleci/config.yml
View file @
ced0a942
...
...
@@ -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
:
...
...
README.md
View file @
ced0a942
...
...
@@ -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
...
...
docs/source/installation.md
View file @
ced0a942
...
...
@@ -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
...
...
examples/summarization/utils_summarization
_test
.py
→
examples/summarization/
test_
utils_summarization.py
View file @
ced0a942
File moved
templates/adding_a_new_model/tests/modeling_tf_xxx
_test
.py
→
templates/adding_a_new_model/tests/
test_
modeling_tf_xxx.py
View file @
ced0a942
...
...
@@ -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
...
...
templates/adding_a_new_model/tests/modeling_xxx
_test
.py
→
templates/adding_a_new_model/tests/
test_
modeling_xxx.py
View file @
ced0a942
...
...
@@ -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
...
...
templates/adding_a_new_model/tests/tokenization_xxx
_test
.py
→
templates/adding_a_new_model/tests/
test_
tokenization_xxx.py
View file @
ced0a942
File moved
tests/configuration_common
_test
.py
→
tests/
test_
configuration_common.py
View file @
ced0a942
File moved
tests/hf_api
_test
.py
→
tests/
test_
hf_api.py
View file @
ced0a942
File moved
tests/model_card
_test
.py
→
tests/
test_
model_card.py
View file @
ced0a942
File moved
tests/modeling_albert
_test
.py
→
tests/
test_
modeling_albert.py
View file @
ced0a942
...
...
@@ -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
...
...
tests/modeling_auto
_test
.py
→
tests/
test_
modeling_auto.py
View file @
ced0a942
File moved
tests/modeling_bert
_test
.py
→
tests/
test_
modeling_bert.py
View file @
ced0a942
...
...
@@ -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
...
...
tests/modeling_common
_test
.py
→
tests/
test_
modeling_common.py
View file @
ced0a942
File moved
tests/modeling_ctrl
_test
.py
→
tests/
test_
modeling_ctrl.py
View file @
ced0a942
...
...
@@ -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
...
...
tests/modeling_distilbert
_test
.py
→
tests/
test_
modeling_distilbert.py
View file @
ced0a942
...
...
@@ -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
...
...
tests/modeling_encoder_decoder
_test
.py
→
tests/
test_
modeling_encoder_decoder.py
View file @
ced0a942
File moved
tests/modeling_gpt2
_test
.py
→
tests/
test_
modeling_gpt2.py
View file @
ced0a942
...
...
@@ -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
...
...
tests/modeling_openai
_test
.py
→
tests/
test_
modeling_openai.py
View file @
ced0a942
...
...
@@ -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
...
...
tests/modeling_roberta
_test
.py
→
tests/
test_
modeling_roberta.py
View file @
ced0a942
...
...
@@ -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
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment