Skip to content

Commit d0e5fd3

Browse files
authored
Fix Playwright and Linters in CI (#435)
* ignore linter errors I'm pretty sure the type annotations on Starlette are wrong - passing a HTTPEndpoint in should be allowed. * try older Ubuntu version for Playwright tests microsoft/playwright#30368 * remove fastapi version pin We need the latest version to get around a breaking change in Starlette's test client: Kludex/starlette#2770 * fix linter errors
1 parent 2f923aa commit d0e5fd3

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

.github/workflows/playwright.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
playwright:
1111
name: "Playwright Tests"
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- name: "Checkout repository"
1515
uses: "actions/checkout@v4"

piccolo_admin/endpoints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ class GroupItem(BaseModel):
100100

101101

102102
class GroupedTableNamesResponseModel(BaseModel):
103-
grouped: t.Dict[str, t.List[str]] = Field(default_factory=list)
103+
grouped: t.Dict[str, t.List[str]] = Field(default_factory=dict)
104104
ungrouped: t.List[str] = Field(default_factory=list)
105105

106106

107107
class GroupedFormsResponseModel(BaseModel):
108108
grouped: t.Dict[str, t.List[FormConfigResponseModel]] = Field(
109-
default_factory=list
109+
default_factory=dict
110110
)
111111
ungrouped: t.List[FormConfigResponseModel] = Field(default_factory=list)
112112

@@ -680,7 +680,7 @@ def __init__(
680680

681681
private_app.add_route(
682682
path="/change-password/",
683-
route=change_password(
683+
route=change_password( # type: ignore
684684
login_url="./../../public/login/",
685685
session_table=session_table,
686686
read_only=read_only,
@@ -786,7 +786,7 @@ def __init__(
786786

787787
public_app.add_route(
788788
path="/logout/",
789-
route=session_logout(session_table=session_table),
789+
route=session_logout(session_table=session_table), # type: ignore
790790
methods=["POST"],
791791
)
792792

requirements/test-requirements.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,5 @@ flake8==7.0.0
44
piccolo[postgres,sqlite]>=1.16.0
55
playwright==1.41.2
66
pytest-playwright==0.4.4
7-
httpx>=0.20.0
8-
# This is needed because newer versions of FastAPI use a Starlette version with
9-
# a `TestClient` which breaks rate limiting.
10-
# The changes to `TestClient` will likely be reverted in a future release, in
11-
# which case we can remove this version pin.
12-
fastapi==0.106.0
7+
httpx==0.28.1
8+
fastapi==0.115.6

0 commit comments

Comments
 (0)