Skip to content

Commit 941d9c9

Browse files
committed
clean up
1 parent 0c5318a commit 941d9c9

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

python/lib/sift_client/_tests/test_pytest_plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
from __future__ import annotations
99

1010
import textwrap
11+
from typing import TYPE_CHECKING
1112

12-
import pytest
13+
if TYPE_CHECKING:
14+
import pytest
1315

1416
pytest_plugins = ["pytester"]
1517

python/lib/sift_client/pytest_plugin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ def sift_client(pytestconfig: pytest.Config) -> SiftClient:
168168
)
169169
return SiftClient(
170170
connection_config=SiftConnectionConfig(
171-
api_key=os.getenv("SIFT_API_KEY"),
172-
grpc_url=os.getenv("SIFT_GRPC_URI"),
173-
rest_url=os.getenv("SIFT_REST_URI"),
171+
api_key=os.environ["SIFT_API_KEY"],
172+
grpc_url=os.environ["SIFT_GRPC_URI"],
173+
rest_url=os.environ["SIFT_REST_URI"],
174174
)
175175
)
176176

@@ -268,7 +268,7 @@ def _step_impl(
268268
def _parametrize_parents(
269269
report_context: ReportContext,
270270
request: pytest.FixtureRequest,
271-
) -> Generator[None, None, None]:
271+
) -> None:
272272
"""Open/close shared parametrize parent steps for the current item.
273273
274274
Diffs the item's desired parametrize path against the open stack: pops the
@@ -293,7 +293,7 @@ def _parametrize_parents(
293293
ns = report_context.new_step(name=display, assertion_as_fail_not_error=False)
294294
ns.__enter__()
295295
_PARAMETRIZE_STACK.append((display, ns))
296-
yield
296+
return None
297297

298298

299299
@pytest.fixture(autouse=True)

python/lib/sift_client/pytest_plugin_noop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from __future__ import annotations
2323

2424
from contextlib import AbstractContextManager
25-
from typing import TYPE_CHECKING, Any, Generator
25+
from typing import TYPE_CHECKING, Any, Generator, Literal
2626

2727
import pytest
2828

@@ -67,7 +67,7 @@ def __init__(self, name: str, description: str | None = None) -> None:
6767
def __enter__(self) -> _NoopStep:
6868
return self
6969

70-
def __exit__(self, exc_type, exc_value, tb) -> bool:
70+
def __exit__(self, exc_type, exc_value, tb) -> Literal[False]:
7171
return False
7272

7373
def measure(

0 commit comments

Comments
 (0)