From 1bf53db267f7ee5b3dac2752616d8c96f275d70a Mon Sep 17 00:00:00 2001 From: burnout87 Date: Thu, 9 Nov 2023 18:33:21 +0100 Subject: [PATCH] using existing fixture --- tests/conftest.py | 13 ------------- tests/test_live.py | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 08bfd83b..6e73ac5b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -103,19 +103,6 @@ def default_token(default_token_payload, secret_key) -> str: return token -@pytest.fixture -def environment_token_clean_up(): - oda_token_cwd_fn = ".oda-token" - if os.path.exists(oda_token_cwd_fn): - os.remove(oda_token_cwd_fn) - - home_dir = os.environ.get('HOME', None) - if home_dir is not None: - oda_token_home_fn = os.path.join(home_dir, ".oda-token") - os.remove(oda_token_home_fn) - - os.environ.pop('ODA_TOKEN', None) - def remove_scratch_folders(job_id=None): if job_id is None: dir_list = glob.glob('scratch_*') diff --git a/tests/test_live.py b/tests/test_live.py index 21c9c861..b9cd14e8 100644 --- a/tests/test_live.py +++ b/tests/test_live.py @@ -82,7 +82,7 @@ def validate_data(data, scw_kind): assert len(t) == 1 -def test_instruments(environment_token_clean_up): +def test_instruments(remove_any_token_from_environment): from oda_api.api import DispatcherAPI disp = DispatcherAPI( host=get_platform_dispatcher(),