Skip to content

Commit eb57a33

Browse files
committed
tests: remove useless conditions in test files
1 parent 3849541 commit eb57a33

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

tests/backends/sql/postgresql.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,11 @@
33
from canaille.app.configuration import settings_factory
44
from canaille.backends.sql.backend import SQLBackend
55

6-
try:
7-
import pytest_postgresql # noqa: F401
8-
9-
PYTEST_POSTGRESQL_AVAILABLE = True
10-
except ImportError:
11-
PYTEST_POSTGRESQL_AVAILABLE = False
12-
136

147
@pytest.fixture
158
def postgresql_configuration(configuration, request):
169
"""Configure Canaille to use PostgreSQL test database."""
17-
if not PYTEST_POSTGRESQL_AVAILABLE:
18-
pytest.skip("pytest-postgresql not available")
10+
pytest.importorskip("pytest_postgresql")
1911

2012
postgresql = request.getfixturevalue("postgresql")
2113
info = postgresql.info

tests/backends/sql/test_alembic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ def test_migrations_with_data(app, backend, user, foo_group):
1818

1919
# IMPORTANT: Close any open transaction before running migrations
2020
# Reading data above may have started an implicit transaction that holds locks
21-
if backend.db_session:
22-
backend.db_session.commit()
21+
backend.db_session.commit()
2322

2423
# Downgrade to first revision (preserves tables and data)
2524
steps_to_first = len(revisions) - 1

0 commit comments

Comments
 (0)