Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through lifespan events #1673

Merged
merged 2 commits into from
Mar 13, 2023
Merged

Pass through lifespan events #1673

merged 2 commits into from
Mar 13, 2023

Conversation

RobbeSneyders
Copy link
Member

Fixes #1672

Lifespan events were being intercepted by the swagger UI middleware. We should let them pass through.

@@ -46,3 +48,13 @@ def test_routing_middleware(middleware_app):
assert (
response.headers.get("operation_id") == "fakeapi.hello.post_greeting"
), response.status_code


async def test_lifecycle():
Copy link
Member

@Ruwann Ruwann Mar 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails on python 3.7 because AsyncMock is only availabe from Python 3.8.
We skip other tests relying on AsyncMock for Python 3.7

Suggested change
async def test_lifecycle():
@pytest.mark.skipif(
sys.version_info < (3, 8), reason="AsyncMock only available from 3.8."
)
async def test_lifecycle():

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4386534208

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 93.367%

Totals Coverage Status
Change from base Build 4348054373: 0.2%
Covered Lines: 3280
Relevant Lines: 3513

💛 - Coveralls

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.

Connexion 3.0.0a2, Starlette, on_startup and on_shutdown
3 participants