Skip to content

Commit 9de6954

Browse files
committed
πŸ› Fix test stage
1 parent 1b718ff commit 9de6954

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

β€Ž.github/workflows/test.ymlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ jobs:
3939
- name: Unit tests sqlalchemy 1.4
4040
run: |
4141
poetry run pip install -U "sqlalchemy>=1.4.11" sqlmodel # FIXME: dependency conflict must be solved
42-
poetry run pytest tests/ext/test_async_sqlalchemy.py tests/ext/test_sqlalchemy_future.py tests/ext/test_sqlmodel.py --cov-append --cov-report=xml
42+
poetry run pytest tests/ext/test_sqlmodel.py --cov-append --cov-report=xml
43+
poetry run pytest tests/ext/test_async_sqlalchemy.py tests/ext/test_sqlalchemy_future.py --cov-append --cov-report=xml
4344
4445
- name: Upload coverage to Codecov
4546
uses: codecov/codecov-action@v1

β€Žtests/ext/test_sqlmodel.pyβ€Ž

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@
1414

1515
@fixture(scope="session")
1616
def engine(database_url):
17-
return create_engine(database_url)
17+
if database_url.startswith("sqlite"):
18+
connect_args = {"check_same_thread": False}
19+
else:
20+
connect_args = {}
21+
22+
return create_engine(database_url, connect_args=connect_args)
1823

1924

2025
@fixture(scope="session")
@@ -44,7 +49,7 @@ def query(request, User):
4449

4550

4651
@fixture(scope="session")
47-
def app(engine, User, SessionLocal, query):
52+
def app(query, engine, User, SessionLocal):
4853
app = FastAPI()
4954

5055
@app.on_event("startup")

0 commit comments

Comments
Β (0)