Skip to content

Commit 4a05f46

Browse files
committed
fix lint and typing
1 parent f8b581e commit 4a05f46

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

airbyte_cdk/test/declarative/test_suites/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from airbyte_cdk.test.declarative.test_suites.connector_base import (
88
ConnectorTestScenario,
9+
ConnectorTestSuiteBase,
910
generate_tests,
1011
)
1112
from airbyte_cdk.test.declarative.test_suites.declarative_sources import (

airbyte_cdk/test/declarative/test_suites/declarative_sources.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from airbyte_cdk.test.declarative.test_suites.source_base import (
1313
SourceTestSuiteBase,
1414
)
15+
from airbyte_cdk.test.declarative.utils.job_runner import IConnector
1516

1617

1718
def md5_checksum(file_path: Path) -> str:
@@ -23,26 +24,31 @@ class DeclarativeSourceTestSuite(SourceTestSuiteBase):
2324
manifest_path = Path("manifest.yaml")
2425
components_py_path: Path | None = None
2526

27+
@classmethod
2628
def create_connector(
27-
self, connector_test: ConnectorTestScenario
28-
) -> ConcurrentDeclarativeSource:
29+
cls,
30+
scenario: ConnectorTestScenario,
31+
) -> IConnector:
2932
"""Create a connector instance for the test suite."""
30-
config = connector_test.get_config_dict()
31-
# catalog = connector_test.get_catalog()
32-
# state = connector_test.get_state()
33-
# source_config = connector_test.get_source_config()
33+
config: dict[str, Any] = scenario.get_config_dict()
34+
# catalog = scenario.get_catalog()
35+
# state = scenario.get_state()
36+
# source_config = scenario.get_source_config()
3437

35-
manifest_dict = yaml.safe_load(self.manifest_path.read_text())
36-
if self.components_py_path and self.components_py_path.exists():
38+
manifest_dict = yaml.safe_load(cls.manifest_path.read_text())
39+
if cls.components_py_path and cls.components_py_path.exists():
3740
os.environ["AIRBYTE_ENABLE_UNSAFE_CODE"] = "true"
38-
config["__injected_components_py"] = self.components_py_path.read_text()
41+
config["__injected_components_py"] = cls.components_py_path.read_text()
3942
config["__injected_components_py_checksums"] = {
40-
"md5": md5_checksum(self.components_py_path),
43+
"md5": md5_checksum(cls.components_py_path),
4144
}
4245

43-
return ConcurrentDeclarativeSource(
44-
config=config,
45-
catalog=None,
46-
state=None,
47-
source_config=manifest_dict,
46+
return cast(
47+
IConnector,
48+
ConcurrentDeclarativeSource(
49+
config=config,
50+
catalog=None,
51+
state=None,
52+
source_config=manifest_dict,
53+
),
4854
)

airbyte_cdk/test/declarative/test_suites/source_base.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"""Base class for source test suites."""
33

44
from dataclasses import asdict
5-
from pathlib import Path
6-
7-
import pytest
85

96
from airbyte_cdk.models import (
107
AirbyteMessage,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enable = true
3232
python = ">=3.10,<3.13"
3333
airbyte-protocol-models-dataclasses = "^0.14"
3434
backoff = "*"
35+
boltons = "^25.0.0"
3536
cachetools = "*"
3637
dpath = "^2.1.6"
3738
dunamai = "^1.22.0"
@@ -83,7 +84,6 @@ sqlalchemy = {version = "^2.0,!=2.0.36", optional = true }
8384
xmltodict = ">=0.13,<0.15"
8485
anyascii = "^0.3.2"
8586
whenever = "^0.6.16"
86-
boltons = "^25.0.0"
8787

8888
[tool.poetry.group.dev.dependencies]
8989
freezegun = "*"

unit_tests/resources/source_pokeapi_w_components_py/integration_tests/test_mini_cat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ class TestSuiteSourcePokeAPI(DeclarativeSourceTestSuite):
3030
working_dir = CONNECTOR_ROOT
3131
manifest_path = get_resource_path("manifest.yaml")
3232
components_py_path = get_resource_path("components.py")
33-
acceptance_test_config_path = get_resource_path("acceptance-test-config.yml")

0 commit comments

Comments
 (0)