Skip to content

Commit

Permalink
Move tests outside of library.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Dec 22, 2019
1 parent 698f9e3 commit 067395d
Show file tree
Hide file tree
Showing 59 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- run: sudo pip install --progress-bar off .
- run: sudo pip install pytest codecov pytest-cov pytest-xdist
- run: sudo pip install tensorboardX scikit-learn
- run: python -m pytest -n 8 --dist=loadfile -s -v ./transformers/tests/ --cov
- run: python -m pytest -n 8 --dist=loadfile -s -v ./tests/ --cov
- run: codecov
run_tests_py3_torch:
working_directory: ~/transformers
Expand All @@ -31,7 +31,7 @@ jobs:
- run: sudo pip install --progress-bar off .
- run: sudo pip install pytest codecov pytest-cov pytest-xdist
- run: sudo pip install tensorboardX scikit-learn
- run: python -m pytest -n 8 --dist=loadfile -s -v ./transformers/tests/ --cov
- run: python -m pytest -n 8 --dist=loadfile -s -v ./tests/ --cov
- run: codecov
run_tests_py3_tf:
working_directory: ~/transformers
Expand All @@ -47,7 +47,7 @@ jobs:
- run: sudo pip install --progress-bar off .
- run: sudo pip install pytest codecov pytest-cov pytest-xdist
- run: sudo pip install tensorboardX scikit-learn
- run: python -m pytest -n 8 --dist=loadfile -s -v ./transformers/tests/ --cov
- run: python -m pytest -n 8 --dist=loadfile -s -v ./tests/ --cov
- run: codecov
run_tests_py3_custom_tokenizers:
working_directory: ~/transformers
Expand All @@ -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 ./transformers/tests/tokenization_bert_japanese_test.py
- run: RUN_CUSTOM_TOKENIZERS=1 python -m pytest -sv ./tests/tokenization_bert_japanese_test.py
run_examples_py3_torch:
working_directory: ~/transformers
docker:
Expand Down Expand Up @@ -97,9 +97,9 @@ jobs:
- run: sudo pip install --editable .
- run: sudo pip install torch tensorflow
- run: sudo pip install black git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort flake8
- run: black --check --line-length 119 examples templates transformers utils
- run: isort --check-only --recursive examples templates transformers utils
- run: flake8 examples templates transformers utils
- run: black --check --line-length 119 examples templates tests transformers utils
- run: isort --check-only --recursive examples templates tests transformers utils
- run: flake8 examples templates tests transformers utils
check_repository_consistency:
working_directory: ~/transformers
docker:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.PHONY: style

style:
black --line-length 119 examples templates transformers utils
isort --recursive examples templates transformers utils
black --line-length 119 examples templates tests transformers utils
isort --recursive examples templates tests transformers utils
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pip install [--editable] .

### Tests

A series of tests are included for the library and the example scripts. Library tests can be found in the [tests folder](https://github.com/huggingface/transformers/tree/master/transformers/tests) and examples tests in the [examples folder](https://github.com/huggingface/transformers/tree/master/examples).
A series of tests are included for the library and the example scripts. Library tests can be found in the [tests folder](https://github.com/huggingface/transformers/tree/master/tests) and examples tests in the [examples folder](https://github.com/huggingface/transformers/tree/master/examples).

These tests can be run using `unittest` or `pytest` (install pytest if needed with `pip install pytest`).

Expand All @@ -110,14 +110,14 @@ 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 transformers/tests -p "*test.py" -t .
python -m unittest discover -s tests -p "*test.py" -t .
python -m unittest discover -s examples -p "*test.py" -t examples
```

or

```bash
python -m pytest -sv ./transformers/tests/
python -m pytest -sv ./tests/
python -m pytest -sv ./examples/
```

Expand Down
6 changes: 3 additions & 3 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ pip install [--editable] .

## Tests

An extensive test suite is included to test the library behavior and several examples. Library tests can be found in the [tests folder](https://github.com/huggingface/transformers/tree/master/transformers/tests) and examples tests in the [examples folder](https://github.com/huggingface/transformers/tree/master/examples).
An extensive test suite is included to test the library behavior and several examples. Library tests can be found in the [tests folder](https://github.com/huggingface/transformers/tree/master/tests) and examples tests in the [examples folder](https://github.com/huggingface/transformers/tree/master/examples).

Tests can be run using `unittest` or `pytest` (install pytest if needed with `pip install pytest`).

Run all the tests from the root of the cloned repository with the commands:

```bash
python -m unittest discover -s transformers/tests -p "*test.py" -t .
python -m unittest discover -s tests -p "*test.py" -t .
python -m unittest discover -s examples -p "*test.py" -t examples
```

or

``` bash
python -m pytest -sv ./transformers/tests/
python -m pytest -sv ./tests/
python -m pytest -sv ./examples/
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 067395d

Please sign in to comment.