Skip to content

Commit 0897b83

Browse files
committed
fix paths
1 parent c3a32ae commit 0897b83

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

airbyte_cdk/test/declarative/test_suites/connector_base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def manifest_yml_path(cls) -> Path:
152152
153153
Give up if the config file is not found in any parent directory.
154154
"""
155-
result = cls.connector_root_dir / MANIFEST_YAML
155+
result = cls.get_connector_root_dir() / MANIFEST_YAML
156156
if result.exists():
157157
return result
158158

@@ -161,8 +161,8 @@ def manifest_yml_path(cls) -> Path:
161161
f"Please check if the file exists in the connector root directory."
162162
)
163163

164-
@classproperty
165-
def connector_root_dir(cls) -> Path:
164+
@classmethod
165+
def get_connector_root_dir(cls) -> Path:
166166
"""Get the root directory of the connector."""
167167
for parent in cls.get_test_class_dir().parents:
168168
if (parent / MANIFEST_YAML).exists():
@@ -189,7 +189,7 @@ def connector_root_dir(cls) -> Path:
189189
@classproperty
190190
def acceptance_test_config_path(cls) -> Path:
191191
"""Get the path to the acceptance test config file."""
192-
result = cls.connector_root_dir / ACCEPTANCE_TEST_CONFIG
192+
result = cls.get_connector_root_dir() / ACCEPTANCE_TEST_CONFIG
193193
if result.exists():
194194
return result
195195

airbyte_cdk/test/declarative/test_suites/source_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_basic_read(
6969
sync_mode=SyncMode.full_refresh,
7070
destination_sync_mode=DestinationSyncMode.append_dedup,
7171
)
72-
for stream in discover_result.catalog.catalog.streams # type: ignore [reportOptionalMemberAccess]
72+
for stream in discover_result.catalog.catalog.streams # type: ignore [reportOptionalMemberAccess, union-attr]
7373
]
7474
)
7575
result = run_test_job(

airbyte_cdk/test/declarative/utils/job_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def run_test_job(
8585
# Because it *also* can fail, we have ot redundantly wrap it in a try/except block.
8686

8787
result: entrypoint_wrapper.EntrypointOutput = entrypoint_wrapper._run_command( # noqa: SLF001 # Non-public API
88-
source=connector_obj, # type: ignore [reportArgumentType]
88+
source=connector_obj, # type: ignore [arg-type]
8989
args=args,
9090
expecting_exception=test_instance.expect_exception,
9191
)

unit_tests/resources/source_pokeapi_w_components_py/integration_tests/test_mini_cat.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
generate_tests,
77
)
88

9-
CONNECTOR_ROOT = Path(__file__).parent.parent
10-
11-
12-
def get_resource_path(file_name: str) -> Path:
13-
"""Get the path to a resource file."""
14-
return CONNECTOR_ROOT / file_name
15-
169

1710
def pytest_generate_tests(metafunc):
1811
generate_tests(metafunc)
@@ -26,7 +19,3 @@ class TestSuiteSourcePokeAPI(DeclarativeSourceTestSuite):
2619
As long as the class name starts with "Test", pytest will automatically discover and run the
2720
tests in this class.
2821
"""
29-
30-
working_dir = CONNECTOR_ROOT
31-
manifest_path = get_resource_path("manifest.yaml")
32-
components_py_path = get_resource_path("components.py")

0 commit comments

Comments
 (0)