Skip to content

Commit

Permalink
test: ignore existing NCBI_API_KEY env var (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson authored Sep 11, 2024
1 parent 6ccb466 commit 9f9fec1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_seqfetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
)


@pytest.fixture(autouse=True)
def clear_env():
"""Some tests in this module assume that the default utils access configs are
active. If you execute tests in an environment with an existing `NCBI_API_KEY` env
var, those tests will fail unless we first remove that variable.
"""
if "NCBI_API_KEY" in os.environ:
del os.environ["NCBI_API_KEY"]


@vcr.use_cassette
def test_fetch_seq():
assert 1596 == len(fetch_seq("NP_056374.2"))
Expand Down

0 comments on commit 9f9fec1

Please sign in to comment.