Skip to content

Commit

Permalink
loading works even though the given library path is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Nov 29, 2020
1 parent 50dae17 commit cbc4eb5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pygmt/tests/test_clib_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ def test_load_libgmt():
check_libgmt(load_libgmt())


def test_load_libgmt_fail():
"Test that loading fails when given a bad library path."
def test_load_libgmt_with_a_bad_library_path():
"Test that loading still works when given a bad library path."
# save the old value (if any) before setting a fake "GMT_LIBRARY_PATH"
old_gmt_library_path = os.environ.get("GMT_LIBRARY_PATH")

os.environ["GMT_LIBRARY_PATH"] = "/not/a/real/path"
with pytest.raises(GMTCLibNotFoundError):
load_libgmt()
check_libgmt(load_libgmt())

# revert back to the original status (if any)
if old_gmt_library_path:
Expand Down

0 comments on commit cbc4eb5

Please sign in to comment.