Skip to content

Commit

Permalink
ALE Spice Directory Fix (#382)
Browse files Browse the repository at this point in the history
* Set mission directories to an empty list if ALESPICEROOT is not set

* Removed ALESPICEROOT environment variable not set warning

* Add and update tests for when no ALESPICEROOT is set
  • Loading branch information
acpaquette authored and jessemapel committed May 30, 2022
1 parent 93c0743 commit 8acadb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion ale/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
try:
spice_root = os.environ['ALESPICEROOT']
except:
warnings.warn('ALESPICEROOT environment variable not set, Spice Drivers will not function correctly')
spice_root = None

# bring ale stuff into main ale module
Expand Down
5 changes: 2 additions & 3 deletions tests/pytests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

def test_env_not_set(monkeypatch):
monkeypatch.delenv('ALESPICEROOT', raising=False)
with pytest.warns(UserWarning, match='ALESPICEROOT environment variable not set'):
reload(ale)
assert not ale.spice_root
reload(ale)
assert not ale.spice_root

def test_env_set(monkeypatch):
monkeypatch.setenv('ALESPICEROOT', '/foo/bar')
Expand Down

0 comments on commit 8acadb5

Please sign in to comment.