diff --git a/smoke_tests/tests/conftest.py b/smoke_tests/tests/conftest.py index ceb25f9d9..4794d1f6f 100644 --- a/smoke_tests/tests/conftest.py +++ b/smoke_tests/tests/conftest.py @@ -136,32 +136,27 @@ def _add_args_for_client_creds_login(api_client_id, api_client_secret, client_ar funcx_authorizer = AccessTokenAuthorizer(funcx_token) auth_authorizer = AccessTokenAuthorizer(auth_token) - try: - from globus_compute_sdk.sdk.login_manager import LoginManagerProtocol - except ImportError: - client_args["fx_authorizer"] = funcx_authorizer - client_args["openid_authorizer"] = auth_authorizer - else: + from globus_compute_sdk.sdk.login_manager import LoginManagerProtocol - class TestsuiteLoginManager: - def ensure_logged_in(self) -> None: - pass + class TestsuiteLoginManager: + def ensure_logged_in(self) -> None: + pass - def logout(self) -> None: - pass + def logout(self) -> None: + pass - def get_auth_client(self) -> AuthClient: - return AuthClient(authorizer=auth_authorizer) + def get_auth_client(self) -> AuthClient: + return AuthClient(authorizer=auth_authorizer) - def get_web_client(self, *, base_url: str | None = None) -> WebClient: - return WebClient(base_url=base_url, authorizer=funcx_authorizer) + def get_web_client(self, *, base_url: str | None = None) -> WebClient: + return WebClient(base_url=base_url, authorizer=funcx_authorizer) - login_manager = TestsuiteLoginManager() + login_manager = TestsuiteLoginManager() - # check runtime-checkable protocol - assert isinstance(login_manager, LoginManagerProtocol) + # check runtime-checkable protocol + assert isinstance(login_manager, LoginManagerProtocol) - client_args["login_manager"] = login_manager + client_args["login_manager"] = login_manager @pytest.fixture(scope="session") diff --git a/smoke_tests/tests/test_running_functions.py b/smoke_tests/tests/test_running_functions.py index f3650476c..d68a838b2 100644 --- a/smoke_tests/tests/test_running_functions.py +++ b/smoke_tests/tests/test_running_functions.py @@ -2,15 +2,10 @@ import typing as t import globus_compute_sdk as gc -import pytest from globus_compute_sdk import Client, Executor +from globus_compute_sdk.errors import TaskPending from packaging.version import Version -try: - from globus_compute_sdk.errors import TaskPending -except ImportError: - from globus_compute_sdk.utils.errors import TaskPending - sdk_version = Version(gc.version.__version__) @@ -33,7 +28,6 @@ def ohai(): return "ohai" -@pytest.mark.skipif(sdk_version.release < (2, 2, 5), reason="batch.add iface updated") def test_batch(compute_client: Client, endpoint: str, linear_backoff: t.Callable): """Test batch submission and get_batch_result""" @@ -77,19 +71,10 @@ def test_wait_on_new_hello_world_func( def test_executor(compute_client, endpoint, tutorial_function_id, timeout_s: int): """Test using Executor to retrieve results.""" - res = compute_client.web_client.get_version() - assert res.http_status == 200, f"Received {res.http_status} instead!" - num_tasks = 10 submit_count = 2 # we've had at least one bug that prevented executor re-use - # use client on newer versions and funcx_client on older - try: - gce = Executor(endpoint_id=endpoint, client=compute_client) - except TypeError: - gce = Executor(endpoint_id=endpoint, funcx_client=compute_client) - - with gce: + with Executor(endpoint_id=endpoint, client=compute_client) as gce: for _ in range(submit_count): futures = [ gce.submit_to_registered_function(tutorial_function_id) diff --git a/smoke_tests/tests/test_s3_indirect.py b/smoke_tests/tests/test_s3_indirect.py index 548dcb063..7dac4e88e 100644 --- a/smoke_tests/tests/test_s3_indirect.py +++ b/smoke_tests/tests/test_s3_indirect.py @@ -1,11 +1,5 @@ import pytest - -try: - from globus_compute_sdk.errors import TaskExecutionFailed - - has_task_exec_error_type = True -except ImportError: - has_task_exec_error_type = False +from globus_compute_sdk.errors import TaskExecutionFailed def large_result_producer(size: int) -> str: @@ -25,9 +19,6 @@ def test_allowed_result_sizes(submit_function_and_get_result, endpoint, size): assert len(r.result) == size -@pytest.mark.skipif( - not has_task_exec_error_type, reason="Test requires newer execution exception type" -) def test_result_size_too_large(submit_function_and_get_result, endpoint): """ Globus Compute should raise a MaxResultSizeExceeded exception when results exceeds @@ -38,8 +29,8 @@ def test_result_size_too_large(submit_function_and_get_result, endpoint): submit_function_and_get_result( endpoint, func=large_result_producer, func_args=(11 * 1024 * 1024,) ) - # ...so unwrap the exception to verify that it's the right type - assert "MaxResultSizeExceeded" in excinfo.value.remote_data + # ...so unwrap the exception to verify that it's the right type + assert "MaxResultSizeExceeded" in excinfo.value.remote_data @pytest.mark.parametrize("size", [200, 2000, 20000, 200000])