mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(deps): upgrade to sqlalchemy version 2
Bump sqlalchemy to version 2.0.22 There are quite some changes that happened with v2. We are currently relying on the "auto-commit" feature which was removed. For the moment we can use a wrapper class to mimic the auto-commit behavior allowing us to move to v2. Ultimately, the (db) session management needs some overhaul though. Signed-off-by: moson <moson@archlinux.org>
This commit is contained in:
parent
27c51430fb
commit
db004d5ebd
12 changed files with 182 additions and 160 deletions
|
@ -1,5 +1,5 @@
|
|||
import pytest
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.exc import IntegrityError, SAWarning
|
||||
|
||||
from aurweb import db, time
|
||||
from aurweb.db import create, rollback
|
||||
|
@ -109,7 +109,7 @@ def test_voteinfo_null_submitter_raises(user: User):
|
|||
|
||||
|
||||
def test_voteinfo_null_agenda_raises(user: User):
|
||||
with pytest.raises(IntegrityError):
|
||||
with pytest.raises(IntegrityError), pytest.warns(SAWarning):
|
||||
with db.begin():
|
||||
create(
|
||||
VoteInfo,
|
||||
|
@ -123,7 +123,7 @@ def test_voteinfo_null_agenda_raises(user: User):
|
|||
|
||||
|
||||
def test_voteinfo_null_user_raises(user: User):
|
||||
with pytest.raises(IntegrityError):
|
||||
with pytest.raises(IntegrityError), pytest.warns(SAWarning):
|
||||
with db.begin():
|
||||
create(
|
||||
VoteInfo,
|
||||
|
@ -137,7 +137,7 @@ def test_voteinfo_null_user_raises(user: User):
|
|||
|
||||
|
||||
def test_voteinfo_null_submitted_raises(user: User):
|
||||
with pytest.raises(IntegrityError):
|
||||
with pytest.raises(IntegrityError), pytest.warns(SAWarning):
|
||||
with db.begin():
|
||||
create(
|
||||
VoteInfo,
|
||||
|
@ -151,7 +151,7 @@ def test_voteinfo_null_submitted_raises(user: User):
|
|||
|
||||
|
||||
def test_voteinfo_null_end_raises(user: User):
|
||||
with pytest.raises(IntegrityError):
|
||||
with pytest.raises(IntegrityError), pytest.warns(SAWarning):
|
||||
with db.begin():
|
||||
create(
|
||||
VoteInfo,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue