From 4b0d41a0dad1e9116f7a2414dec2742d6c82dd69 Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Thu, 21 Nov 2024 18:46:58 -0500 Subject: [PATCH] Update tests --- .../dagster_fivetran_tests/experimental/conftest.py | 1 + .../dagster_fivetran_tests/experimental/test_resources.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/conftest.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/conftest.py index e804495046fcd..86d10da45c82b 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/conftest.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/conftest.py @@ -155,6 +155,7 @@ }, } + # Taken from Fivetran API documentation # https://fivetran.com/docs/rest-api/api-reference/connectors/connector-details # The sample is parameterized to test the poll method diff --git a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py index 6f99ce709ae22..a2ee8f6f5fa02 100644 --- a/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py +++ b/python_modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py @@ -80,7 +80,7 @@ def test_basic_resource_request( # Timed out poll all_api_mocks.calls.reset() - with pytest.raises(Failure) as e: + with pytest.raises(Failure, match=f"Sync for connector '{connector_id}' timed out"): client.poll_sync( connector_id=connector_id, # The poll process will time out because the value of @@ -89,7 +89,6 @@ def test_basic_resource_request( poll_timeout=2, poll_interval=1, ) - assert f"Sync for connector '{connector_id}' timed out" in str(e.value) # Failed poll all_api_mocks.calls.reset() @@ -102,11 +101,10 @@ def test_basic_resource_request( ), status=200, ) - with pytest.raises(Failure) as e: + with pytest.raises(Failure, match=f"Sync for connector '{connector_id}' failed!"): client.poll_sync( connector_id=connector_id, previous_sync_completed_at=parser.parse(MIN_TIME_STR), poll_timeout=2, poll_interval=1, ) - assert f"Sync for connector '{connector_id}' failed!" in str(e.value)