style: Run pre-commit

This commit is contained in:
Joakim Saario 2022-08-21 22:08:29 +02:00
parent b47882b114
commit 9c6c13b78a
No known key found for this signature in database
GPG key ID: D8B76D271B7BD453
235 changed files with 7180 additions and 5628 deletions

View file

@ -1,5 +1,4 @@
import pytest
from sqlalchemy.exc import IntegrityError
from aurweb import db
@ -16,17 +15,21 @@ def setup(db_test):
@pytest.fixture
def user() -> User:
with db.begin():
user = db.create(User, Username="test", Email="test@example.org",
RealName="Test User", Passwd="testPassword",
AccountTypeID=USER_ID)
user = db.create(
User,
Username="test",
Email="test@example.org",
RealName="Test User",
Passwd="testPassword",
AccountTypeID=USER_ID,
)
yield user
@pytest.fixture
def pkgbase(user: User) -> PackageBase:
with db.begin():
pkgbase = db.create(PackageBase, Name="beautiful-package",
Maintainer=user)
pkgbase = db.create(PackageBase, Name="beautiful-package", Maintainer=user)
yield pkgbase
@ -44,7 +47,7 @@ def test_package_base(user: User, pkgbase: PackageBase):
def test_package_base_ci(user: User, pkgbase: PackageBase):
""" Test case insensitivity of the database table. """
"""Test case insensitivity of the database table."""
with pytest.raises(IntegrityError):
with db.begin():
db.create(PackageBase, Name=pkgbase.Name.upper(), Maintainer=user)