diff --git a/src/sfapi_client/_sync/client.py b/src/sfapi_client/_sync/client.py index 823ec1e..039ab2a 100644 --- a/src/sfapi_client/_sync/client.py +++ b/src/sfapi_client/_sync/client.py @@ -383,10 +383,7 @@ def get(self, url: str, params: Dict[str, Any] = {}) -> httpx.Response: stop=tenacity.stop_after_attempt(MAX_RETRY), ) def post( - self, - url: str, - data: Dict[str, Any] = None, - json: Dict[str, Any] = None + self, url: str, data: Dict[str, Any] = None, json: Dict[str, Any] = None ) -> httpx.Response: client = self._http_client() diff --git a/tests/test_jobs.py b/tests/test_jobs.py index 2f0f787..497f971 100755 --- a/tests/test_jobs.py +++ b/tests/test_jobs.py @@ -2,7 +2,6 @@ from concurrent.futures import ThreadPoolExecutor import time -from sfapi_client import Client from sfapi_client.jobs import JobState from sfapi_client.compute import Compute from sfapi_client.jobs import JobSqueue @@ -52,22 +51,13 @@ def test_complete_timeout(authenticated_client, test_job_path, test_machine): job.complete(timeout=10) -@pytest.mark.api_dev def test_job_monitor_check_request( mocker, - dev_client_id, - dev_client_secret, + authenticated_client, test_job_path, test_machine, - dev_api_url, - dev_token_url, ): - with Client( - client_id=dev_client_id, - secret=dev_client_secret, - api_base_url=dev_api_url, - token_url=dev_token_url, - ) as client: + with authenticated_client as client: num_jobs = 10 _fetch_jobs = mocker.patch("sfapi_client._monitor._fetch_jobs") @@ -122,24 +112,14 @@ def _jobs(*arg, **kwargs): assert len(ids) == num_jobs -# We currently run this in api-dev as its a new feature deployed there -@pytest.mark.api_dev def test_job_monitor_multiple_threads( - dev_client_id, - dev_client_secret, + authenticated_client, test_job_path, test_machine, - dev_api_url, - dev_token_url, ): num_jobs = 5 - with Client( - client_id=dev_client_id, - secret=dev_client_secret, - api_base_url=dev_api_url, - token_url=dev_token_url, - ) as client: + with authenticated_client as client: machine = client.compute(test_machine) jobs = [] diff --git a/tests/test_jobs_async.py b/tests/test_jobs_async.py index 71d54be..3c1b5ab 100755 --- a/tests/test_jobs_async.py +++ b/tests/test_jobs_async.py @@ -1,7 +1,6 @@ import pytest import asyncio -from sfapi_client import AsyncClient from sfapi_client.compute import AsyncCompute from sfapi_client.jobs import AsyncJobSqueue, AsyncJobSacct, JobState @@ -162,23 +161,11 @@ async def test_job_monitor_job_types(async_authenticated_client, mocker, test_ma assert kwargs["job_type"] == AsyncJobSacct -# We currently run this in api-dev as its a new feature deployed there -@pytest.mark.api_dev @pytest.mark.asyncio async def test_job_monitor_gather( - dev_client_id, - dev_client_secret, - test_job_path, - test_machine, - dev_api_url, - dev_token_url, + async_authenticated_client, test_job_path, test_machine ): - async with AsyncClient( - client_id=dev_client_id, - secret=dev_client_secret, - api_base_url=dev_api_url, - token_url=dev_token_url, - ) as client: + async with async_authenticated_client as client: machine = await client.compute(test_machine) submit_tasks = []