Skip to content

Commit

Permalink
Skip client tests if api key not in env
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed May 24, 2021
1 parent 1db96b7 commit 26db338
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from mp_api.core.client import MPRestError
import os
from mp_api.matproj import MPRester

key_only_resters = {
Expand Down Expand Up @@ -33,3 +33,7 @@ def test_generic_get_methods(rester):
elif name not in special_resters:
doc = rester.get_document_by_id(key_only_resters[name], fields=[rester.primary_key])
assert isinstance(doc, rester.document_model)


if os.environ.get("MP_API_KEY", None) is None:
pytest.mark.skip(test_generic_get_methods)

0 comments on commit 26db338

Please sign in to comment.