test examples (#3643)
* test examples * testing * testing * typo * req * exception Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com> Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
This commit is contained in:
parent
c94c0a2b1e
commit
aa52c930f4
|
@ -63,6 +63,7 @@ jobs:
|
|||
python -c "fname = 'requirements/base.txt' ; req = open(fname).read().replace('>=', '==') ; open(fname, 'w').write(req)"
|
||||
python -c "fname = 'requirements/extra.txt' ; req = open(fname).read().replace('>=', '==') ; open(fname, 'w').write(req)"
|
||||
python -c "fname = 'requirements/test.txt' ; req = open(fname).read().replace('>=', '==') ; open(fname, 'w').write(req)"
|
||||
python -c "fname = 'requirements/examples.txt' ; req = open(fname).read().replace('>=', '==') ; open(fname, 'w').write(req)"
|
||||
|
||||
# Note: This uses an internal pip API and may not always work
|
||||
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
|
||||
|
@ -110,7 +111,7 @@ jobs:
|
|||
- name: Tests
|
||||
run: |
|
||||
# NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003
|
||||
coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
|
||||
coverage run --source pytorch_lightning -m pytest pytorch_lightning tests pl_examples -v --durations=0 --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
|
||||
|
||||
- name: Upload pytest test results
|
||||
uses: actions/upload-artifact@master
|
||||
|
|
|
@ -23,7 +23,7 @@ from torch.utils.data import random_split
|
|||
try:
|
||||
from torchvision.datasets.mnist import MNIST
|
||||
from torchvision import transforms
|
||||
except Exception as e:
|
||||
except ModuleNotFoundError:
|
||||
from tests.base.datasets import MNIST
|
||||
|
||||
|
||||
|
|
|
@ -5,4 +5,7 @@
|
|||
-r ./extra.txt
|
||||
|
||||
# extended list of dependencies dor development and run lint and tests
|
||||
-r ./test.txt
|
||||
-r ./test.txt
|
||||
|
||||
# install all extra dependencies for running examples
|
||||
-r ./examples.txt
|
|
@ -1,2 +1,2 @@
|
|||
torchvision>=0.4.0
|
||||
torchvision>=0.4.1
|
||||
gym>=0.17.0
|
Loading…
Reference in New Issue