Skip to content

Commit

Permalink
PEP8 fixes and added in changes to travis which were erroneously
Browse files Browse the repository at this point in the history
omitted in previous commit.
  • Loading branch information
aidanheerdegen committed Dec 6, 2019
1 parent 280abc9 commit 9fa8acd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_script:
script:
- payu list
- pylint --extension-pkg-whitelist=netCDF4 -E payu
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 || $TRAVIS_PYTHON_VERSION == 3.7 ]]; then PYTHONPATH=$(pwd) coverage run --source payu -m py.test test/test_payu.py test/test_manifest.py; fi;
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 || $TRAVIS_PYTHON_VERSION == 3.7 ]]; then PYTHONPATH=$(pwd) coverage run --source payu -m py.test test/*.py; fi;
after_success:
- coverage report -m
- coveralls
15 changes: 8 additions & 7 deletions test/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@

from payu.laboratory import Laboratory

from common import cd, make_random_file, get_manifests, tmpdir, ctrldir, labdir, workdir
from common import cd, make_random_file, get_manifests
from common import tmpdir, ctrldir, labdir, workdir
from common import config, sweep_work, payu_init, payu_setup
from common import write_config, make_exe, make_inputs, make_restarts, make_all_files
from common import write_config
from common import make_exe, make_inputs, make_restarts, make_all_files

verbose = True


def setup_module(module):
"""
Put any test-wide setup code in here, e.g. creating test files
Expand Down Expand Up @@ -53,7 +56,7 @@ def teardown_module(module):
print(e)


def test_laboratory():
def test_laboratory_basepath():

# Test instantiating a Laboratory object
with cd(ctrldir):
Expand All @@ -72,15 +75,13 @@ def test_laboratory():
write_config()
with cd(ctrldir):
lab = Laboratory(None, None, None)

shortpath = '.'
for path in ['/short', '/scratch']:
if Path(path).exists():
shortpath = path
break

# pdb.set_trace()

assert(Path(lab.basepath).parents[2] == Path(shortpath))
assert(Path(lab.basepath).parts[2] == os.environ['PROJECT'])
assert(Path(lab.basepath).parts[-1] == 'lab')
assert(Path(lab.basepath).parts[-1] == 'lab')

0 comments on commit 9fa8acd

Please sign in to comment.