Skip to content

Commit

Permalink
Remove test files rather than have git ignore them
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Hill committed Jun 16, 2018
1 parent 7a6fd9e commit d4ace71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ target/
# aospy-specific
example-output/
example-tar-output/
test-files/
test-tar-files/

# Dask
dask-worker-space/
19 changes: 12 additions & 7 deletions aospy/test/test_calc_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ def _test_output_attrs(calc, dtype_out):
assert expected_description == arr.attrs['description']


def _clean_test_direcs():
for direc in [example_proj.direc_out, example_proj.tar_direc_out]:
try:
shutil.rmtree(direc)
except OSError:
pass


def _test_files_and_attrs(calc, dtype_out):
assert isfile(calc.path_out[dtype_out])
assert isfile(calc.path_tar_out)
Expand Down Expand Up @@ -95,11 +103,7 @@ def test_params(request):
'dtype_in_vert': vert_in,
'dtype_out_vert': vert_out
}
for direc in [example_proj.direc_out, example_proj.tar_direc_out]:
try:
shutil.rmtree(direc)
except OSError:
pass
_clean_test_direcs()


def test_annual_mean(test_params):
Expand Down Expand Up @@ -254,8 +258,7 @@ def recursive_test_params():

yield (basic_params, recursive_params)

for direc in [example_proj.direc_out, example_proj.tar_direc_out]:
shutil.rmtree(direc)
_clean_test_direcs()


def test_recursive_calculation(recursive_test_params):
Expand Down Expand Up @@ -294,6 +297,7 @@ def test_compute_pressure():
)
calc.compute()
_test_files_and_attrs(calc, 'av')
_clean_test_direcs()


def test_compute_pressure_thicknesses():
Expand All @@ -312,6 +316,7 @@ def test_compute_pressure_thicknesses():
)
calc.compute()
_test_files_and_attrs(calc, 'av')
_clean_test_direcs()


@pytest.mark.parametrize(
Expand Down

0 comments on commit d4ace71

Please sign in to comment.