Skip to content

Commit 28f9995

Browse files
committed
set default value pytest plugin infrahub_key to INFRAHUB_API_TOKEN
1 parent fec58e0 commit 28f9995

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

infrahub_sdk/pytest_plugin/plugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from pathlib import Path
23
from typing import Optional, Union
34

@@ -33,6 +34,7 @@ def pytest_addoption(parser: Parser) -> None:
3334
"--infrahub-key",
3435
action="store",
3536
dest="infrahub_key",
37+
default=os.getenv("INFRAHUB_API_TOKEN"),
3638
metavar="INFRAHUB_TESTS_API_KEY",
3739
help="Key to use when querying the Infrahub instance for live testing",
3840
)

0 commit comments

Comments
 (0)