Skip to content

Commit 7836e41

Browse files
authored
Merge pull request #37 from TikHub/v2.1.0
fix: lint errors in generate_examples.py and CLI test stderr handling
2 parents 5e98c40 + df9c17f commit 7836e41

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/generate_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def render_example_file(
242242
lines.append("")
243243
lines.append("")
244244
lines.append("async def main():")
245-
lines.append(f" async with AsyncTikHub(api_key=API_KEY) as client:")
245+
lines.append(" async with AsyncTikHub(api_key=API_KEY) as client:")
246246

247247
for entry in ops:
248248
kwargs, body_kind = collect_call_kwargs(entry["op"], spec)
@@ -257,7 +257,7 @@ def render_example_file(
257257
lines.append(f" # {summary.rstrip()}")
258258

259259
if body_kind == "multipart":
260-
lines.append(f" # Skipped: multipart upload (needs a real file)")
260+
lines.append(" # Skipped: multipart upload (needs a real file)")
261261
else:
262262
if kwargs:
263263
args = ", ".join(f"{k}={py_literal(v)}" for k, v in kwargs.items())

tests/unit/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def test_health_no_api_key():
150150
result = runner.invoke(app, ["health"])
151151
assert result.exit_code == 2
152152
# Confirm it's the SDK config error, not a typer crash.
153-
assert "API key" in result.stderr or "API key" in result.stdout
153+
assert "API key" in result.output
154154

155155

156156
def test_health_upstream_error(monkeypatch: pytest.MonkeyPatch):
@@ -173,4 +173,4 @@ def handler(request: httpx.Request) -> httpx.Response:
173173
)
174174
result = runner.invoke(app, ["health"])
175175
assert result.exit_code == 1
176-
assert "500" in (result.stderr + result.stdout)
176+
assert "500" in result.output

0 commit comments

Comments
 (0)