diff --git a/.travis.yml b/.travis.yml index ec7f80d2f9..fb1f8c9541 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,9 @@ script: after_success: - coverage report - - codecov + # disable auto coverage bc it isn't accurate since it misses gpu code. + # to get coverage, run local and push results + # - codecov notifications: email: false diff --git a/appveyor.yml b/appveyor.yml index 57c6294d4d..ad03a4786b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -63,4 +63,4 @@ test_script: on_success: - coverage report - - codecov + # - codecov diff --git a/tests/README.md b/tests/README.md index a121ff1414..032cf04f1d 100644 --- a/tests/README.md +++ b/tests/README.md @@ -17,7 +17,7 @@ pip install -e . pip install -r requirements.txt # run tests -py.test +py.test -v ``` To test models that require GPU make sure to run the above command on a GPU machine. @@ -50,10 +50,14 @@ cd pytorch-lightning # generate coverage pip install coverage -coverage run tests/test_models.py +coverage run --source pytorch_lightning -m py.test pytorch_lightning tests examples -v --doctest-modules # print coverage stats -coverage report -m +coverage report -m + +# exporting resulys +coverage xml +codecov -t 17327163-8cca-4a5d-86c8-ca5f2ef700bc -v ``` diff --git a/tests/test_models.py b/tests/test_models.py index 044f2391bb..cd03d8b411 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,20 +1,22 @@ import os import shutil import warnings +from argparse import Namespace import pytest import numpy as np import torch -from pytorch_lightning import Trainer -from examples import LightningTemplateModel -from pytorch_lightning.testing.lm_test_module import LightningTestModel -from argparse import Namespace from test_tube import Experiment, SlurmCluster + +# sys.path += [os.path.abspath('..'), os.path.abspath('../..')] +from pytorch_lightning import Trainer +from pytorch_lightning.testing.lm_test_module import LightningTestModel from pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping from pytorch_lightning.utilities.debugging import MisconfigurationException from pytorch_lightning.root_module import memory from pytorch_lightning.models.trainer import reduce_distributed_output from pytorch_lightning.root_module import model_saving +from examples import LightningTemplateModel SEED = 2334 torch.manual_seed(SEED) diff --git a/tox.ini b/tox.ini index 111bae586d..a91ac5efce 100644 --- a/tox.ini +++ b/tox.ini @@ -34,9 +34,7 @@ deps = commands = check-manifest --ignore tox.ini python setup.py check -m -s - # disable auto coverage bc it isn't accurate since it misses gpu code. - # to get coverage, run local and push results - # coverage run --source pytorch_lightning -m py.test pytorch_lightning tests examples -v --doctest-modules + coverage run --source pytorch_lightning -m py.test pytorch_lightning tests examples -v --doctest-modules flake8 . [flake8]