Skip to content

Commit 9fcc198

Browse files
committed
fix: resolve false-positive failures when discover doesn't trigger expected failure (due to static schemas)
1 parent 5d21ad9 commit 9fcc198

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

airbyte_cdk/test/standard_tests/source_base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from dataclasses import asdict
55
from typing import TYPE_CHECKING
66

7+
import pytest
8+
79
from airbyte_cdk.models import (
810
AirbyteMessage,
911
AirbyteStream,
@@ -59,6 +61,13 @@ def test_discover(
5961
scenario: ConnectorTestScenario,
6062
) -> None:
6163
"""Standard test for `discover`."""
64+
if scenario.expected_outcome.expect_exception():
65+
# If the scenario expects an exception, we can't ensure it specifically would fail
66+
# in discover, because some discover implementations do not need to make a connection.
67+
# We skip this test in that case.
68+
pytest.skip("Skipping discover test for scenario that expects an exception.")
69+
return
70+
6271
run_test_job(
6372
self.create_connector(scenario),
6473
"discover",

0 commit comments

Comments
 (0)