Skip to content

Commit

Permalink
Fix test runner override and no-data (#2242)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored and DPeterK committed Nov 16, 2016
1 parent 8c116ad commit 15ad8f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions lib/iris/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,11 @@ def get_dir_option(section, option, default=None):
# Override the data repository if the appropriate environment variable
# has been set. This is used in setup.py in the TestRunner command to
# enable us to simulate the absence of external data.
override = os.environ.get("override_test_data_repository")
override = os.environ.get("OVERRIDE_TEST_DATA_REPOSITORY")
if override:
if override == '1':
TEST_DATA_DIR = None
else:
TEST_DATA_DIR = override
TEST_DATA_DIR = None
if os.path.isdir(os.path.expanduser(override)):
TEST_DATA_DIR = os.path.abspath(override)

PALETTE_PATH = get_dir_option(_RESOURCE_SECTION, 'palette_path',
os.path.join(CONFIG_PATH, 'palette'))
Expand Down
3 changes: 2 additions & 1 deletion lib/iris/tests/runner/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def finalize_options(self):
# processes that nose.run creates.
if self.no_data:
print('Running tests in no-data mode...')
os.environ['override_test_data_repository'] = 'true'
import iris.config
iris.config.TEST_DATA_DIR = None
if self.create_missing:
os.environ['IRIS_TEST_CREATE_MISSING'] = 'true'

Expand Down

0 comments on commit 15ad8f6

Please sign in to comment.