diff --git a/pyproject.toml b/pyproject.toml index f7c18f2..398fcbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,9 @@ obsws-cli = "obsws_cli:app" [tool.hatch.version] path = "obsws_cli/__about__.py" +[tool.hatch.env] +requires = ["hatch-dotenv"] + [tool.hatch.envs.default] dependencies = ["click-man>=0.5.1"] @@ -45,6 +48,10 @@ man = "python man/generate.py --output=./man" [tool.hatch.envs.hatch-test] randomize = true +[tool.hatch.env.collectors.dotenv.hatch-test] +env-files = [".env", ".test.env"] +fail-on-missing = true + [tool.hatch.envs.types] extra-dependencies = ["mypy>=1.0.0"] [tool.hatch.envs.types.scripts] diff --git a/tests/conftest.py b/tests/conftest.py index 07a4628..ab9ddb4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,7 +4,6 @@ import os import time import obsws_python as obsws -from dotenv import find_dotenv, load_dotenv def pytest_configure(config): @@ -34,14 +33,12 @@ def pytest_sessionstart(session): ) print(' '.join(out)) - load_dotenv(find_dotenv('.test.env')) - session.obsws.set_stream_service_settings( 'rtmp_common', { 'service': 'Twitch', 'server': 'auto', - 'key': os.environ['OBS_STREAM_KEY'], + 'key': os.environ['OBSWS_CLI_TESTS_STREAM_KEY'], }, ) @@ -63,7 +60,7 @@ def pytest_sessionstart(session): 'linux': 'pulse_output_capture', 'darwin': 'coreaudio_output_capture', } - platform = os.environ.get('OBS_TESTS_PLATFORM', os.uname().sysname.lower()) + platform = os.environ['OBSWS_CLI_TESTS_PLATFORM'] try: session.obsws.create_input( sceneName='pytest_scene',