Skip to content

fix: use TestClient in default_app integration test so lifespan runs#15

Merged
yoonji57 merged 6 commits into
chore/devfrom
fix/integration-test-default-app-use-testclient
Mar 18, 2026
Merged

fix: use TestClient in default_app integration test so lifespan runs#15
yoonji57 merged 6 commits into
chore/devfrom
fix/integration-test-default-app-use-testclient

Conversation

@yoonji57
Copy link
Copy Markdown
Collaborator

What changed

  • \ est_default_app_wires_the_real_command_stack\ now uses \TestClient(create_app())\ instead of async
    equest(app, ...).

Why


  • equest()\ with httpx ASGITransport does not run the app lifespan, so \�pp.state.command_executor\ was never set and the test got 500.
  • \TestClient\ runs lifespan on context entry so the default stack is wired correctly.

Tests

  • automated: \pytest tests/integration/\ (21 passed)
  • manual smoke: not run

Docs updated

  • none

Known limitations

  • none

Made with Cursor

- Skip expired EXPIREAT entries during replay.

- Append only on successful write results and flush per entry.

- Enforce EXPIREAT expires_at to remain a float.

Made-with: Cursor
Remove conflict markers from main and integration tests.

Made-with: Cursor
- Set app.state.command_executor only when provided so lifespan can set it.

- Always call store.expireat on replay so expired keys are removed.

- Update persistence unit test expectation.

Made-with: Cursor
request() with ASGITransport does not trigger lifespan; TestClient does.

Made-with: Cursor
@yoonji57 yoonji57 merged commit 3365cb0 into chore/dev Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant