diff --git a/tests/.env.example b/tests/.env.example index e0ce210..60a0511 100644 --- a/tests/.env.example +++ b/tests/.env.example @@ -3,4 +3,5 @@ ACCOUNT_ID= GENSHIN_PLAYER_ID= STARRAIL_PLAYER_ID= # STOKEN= -# LOGIN_TICKET= \ No newline at end of file +# LOGIN_TICKET= +# TEST_BUILD= \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index c70f944..86fffb5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -71,3 +71,9 @@ def stoken() -> Optional[str]: # skipcq: PY-D0003 def login_ticket() -> Optional[str]: # skipcq: PY-D0003 _login_ticket = os.environ.get("LOGIN_TICKET") return _login_ticket + + +@pytest.fixture(scope="session") +def if_test_build() -> bool: # skipcq: PY-D0003 + _test_build = bool(os.environ.get("TEST_BUILD", False)) + return _test_build diff --git a/tests/test_setup.py b/tests/test_setup.py index 557ac5a..2e48f39 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -1,5 +1,9 @@ import os +import pytest -def test_build(): + +def test_build(if_test_build: bool): + if not if_test_build: + pytest.skip("TEST_BUILD not enabled") assert os.system("python setup.py") == 0 # pragma: no cover