Skip to content

Commit

Permalink
test: fix broken tests due to wild card import (#1240)
Browse files Browse the repository at this point in the history
WilliamBergamin authored Jan 29, 2025
1 parent 63598b0 commit 276eae6
Showing 6 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version:
- "3.6"
2 changes: 1 addition & 1 deletion requirements/adapter.txt
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ pyramid>=1,<3
sanic>=20,<21; python_version=="3.6"
sanic>=21,<24; python_version>"3.6" and python_version<="3.8"
sanic>=21,<25; python_version>"3.8"
starlette>=0.14,<1
starlette>=0.19.1,<1
tornado>=6,<7
uvicorn<1 # The oldest version can vary among Python runtime versions
gunicorn>=20,<24
3 changes: 2 additions & 1 deletion tests/adapter_tests/starlette/test_fastapi.py
Original file line number Diff line number Diff line change
@@ -206,7 +206,8 @@ async def endpoint(req: Request):
return await app_handler.handle(req)

client = TestClient(api)
response = client.get("/slack/install", allow_redirects=False)
client.follow_redirects = False
response = client.get("/slack/install")
assert response.status_code == 200
assert response.headers.get("content-type") == "text/html; charset=utf-8"
assert "https://slack.com/oauth/v2/authorize?state=" in response.text
3 changes: 2 additions & 1 deletion tests/adapter_tests/starlette/test_starlette.py
Original file line number Diff line number Diff line change
@@ -215,7 +215,8 @@ async def endpoint(req: Request):
routes=[Route("/slack/install", endpoint=endpoint, methods=["GET"])],
)
client = TestClient(api)
response = client.get("/slack/install", allow_redirects=False)
client.follow_redirects = False
response = client.get("/slack/install")
assert response.status_code == 200
assert response.headers.get("content-type") == "text/html; charset=utf-8"
assert "https://slack.com/oauth/v2/authorize?state=" in response.text
3 changes: 2 additions & 1 deletion tests/adapter_tests_async/test_async_fastapi.py
Original file line number Diff line number Diff line change
@@ -206,7 +206,8 @@ async def endpoint(req: Request):
return await app_handler.handle(req)

client = TestClient(api)
response = client.get("/slack/install", allow_redirects=False)
client.follow_redirects = False
response = client.get("/slack/install")
assert response.status_code == 200
assert response.headers.get("content-type") == "text/html; charset=utf-8"
assert response.headers.get("content-length") == "607"
3 changes: 2 additions & 1 deletion tests/adapter_tests_async/test_async_starlette.py
Original file line number Diff line number Diff line change
@@ -216,7 +216,8 @@ async def endpoint(req: Request):
)

client = TestClient(api)
response = client.get("/slack/install", allow_redirects=False)
client.follow_redirects = False
response = client.get("/slack/install")
assert response.status_code == 200
assert response.headers.get("content-type") == "text/html; charset=utf-8"
assert response.headers.get("content-length") == "607"

0 comments on commit 276eae6

Please sign in to comment.