Skip to content

Commit 31ad959

Browse files
committed
fix mypy
1 parent 6cd27c7 commit 31ad959

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

airbyte_cdk/test/standard_tests/docker_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from dataclasses import asdict
1212
from pathlib import Path
1313
from subprocess import CompletedProcess, SubprocessError
14+
from typing import Literal
1415

1516
import orjson
1617
import pytest

airbyte_cdk/test/standard_tests/pytest_hooks.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
```
1414
"""
1515

16-
from typing import Literal
16+
from typing import Literal, cast
1717

1818
import pytest
1919

2020

2121
@pytest.fixture
2222
def connector_image_override(request: pytest.FixtureRequest) -> str | None:
2323
"""Return the value of --connector-image, or None if not set."""
24-
return request.config.getoption("--connector-image")
24+
return cast(str | None, request.config.getoption("--connector-image"))
2525

2626

2727
@pytest.fixture
@@ -41,14 +41,14 @@ def read_from_streams(
4141
- `--read-from-streams=false`: Do not read from any streams.
4242
- `--read-from-streams=none`: Do not read from any streams.
4343
"""
44-
input_val: str | bool | None = request.config.getoption(
44+
input_val: str = request.config.getoption(
4545
"--read-from-streams",
46-
default="suggested", # type: ignore
46+
default="default", # type: ignore
4747
) # type: ignore
4848

4949
if isinstance(input_val, str):
5050
if input_val.lower() == "false":
51-
return False
51+
return "none"
5252
if input_val.lower() in ["true", "suggested", "default"]:
5353
# Default to 'default' (suggested) streams if the input is 'true', 'suggested', or
5454
# 'default'.
@@ -64,7 +64,7 @@ def read_from_streams(
6464
return input_val.split(",")
6565

6666
# Else, probably a bool; return it as is.
67-
return input_val or False
67+
return input_val or "none"
6868

6969

7070
@pytest.fixture
@@ -82,7 +82,13 @@ def read_scenarios(
8282
- `--read-scenarios=scenario1,scenario2`: Read the specified scenarios only.
8383
8484
"""
85-
input_val = request.config.getoption("--read-scenarios", default="default")
85+
input_val = cast(
86+
str,
87+
request.config.getoption(
88+
"--read-scenarios",
89+
default="default", # type: ignore
90+
),
91+
)
8692

8793
if input_val.lower() == "default":
8894
# Default config scenario is always 'config.json'.

0 commit comments

Comments
 (0)