Skip to content

Commit

Permalink
Added mechanism to determine whether the test suite is being run from…
Browse files Browse the repository at this point in the history
… my own personal machine, and to accordingly select which tests are run
  • Loading branch information
Andrew Hearin committed Jul 23, 2015
1 parent 9923459 commit bd035cb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions halotools/sim_manager/tests/test_catalog_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@

from unittest import TestCase

import pytest
### Determine whether the machine is mine
# This will be used to select tests whose
# returned values depend on the configuration
# of my personal cache directory files
aph_home = u'/Users/aphearin'
detected_home = _find_home()
if aph_home == detected_home:
APH_MACHINE = True
else:
APH_MACHINE = False


class TestCatalogManager(TestCase):


Expand Down Expand Up @@ -94,6 +107,7 @@ def defensively_create_empty_dir(dirname):
full_fname = os.path.join(p, f)
assert os.path.isfile(full_fname)

@pytest.mark.skipif('not APH_MACHINE')
def test_processed_halo_tables_in_cache(self):

for simname in self.simnames:
Expand Down Expand Up @@ -177,6 +191,7 @@ def test_processed_halo_tables_available_for_download(self):
simname='bolshoi', halo_finder='rockstar')
assert file_list != []

@pytest.mark.skipif('not APH_MACHINE')
def test_closest_processed_halo_table_in_cache(self):

catalog_type = 'halos'
Expand All @@ -191,6 +206,7 @@ def test_closest_processed_halo_table_in_cache(self):
correct_basename = 'hlist_1.00035.list.halotools.alpha.version0.hdf5'
assert os.path.basename(closest_fname) == correct_basename

@pytest.mark.skipif('not APH_MACHINE')
def test_closest_ptcl_table_in_cache(self):

catalog_type = 'particles'
Expand Down

0 comments on commit bd035cb

Please sign in to comment.