From bd035cbf76875168f83e2ad4307951045216fc5c Mon Sep 17 00:00:00 2001 From: Andrew Hearin Date: Thu, 23 Jul 2015 10:11:37 -0400 Subject: [PATCH] Added mechanism to determine whether the test suite is being run from my own personal machine, and to accordingly select which tests are run --- .../sim_manager/tests/test_catalog_manager.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/halotools/sim_manager/tests/test_catalog_manager.py b/halotools/sim_manager/tests/test_catalog_manager.py index ab6337cb3..21fa64ee5 100644 --- a/halotools/sim_manager/tests/test_catalog_manager.py +++ b/halotools/sim_manager/tests/test_catalog_manager.py @@ -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): @@ -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: @@ -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' @@ -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'