Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from app import app
from app import db as _db
from app.utils import standardize_response
from sqlalchemy.exc import DBAPIError

TEST_DATABASE_URI = 'sqlite:///:memory:'

Expand Down Expand Up @@ -190,7 +191,7 @@ def fake_category_query_error(mocker):
Mocks an exception being raised during a query to test error handling
"""

mocker.patch('app.models.Category.query', new=None)
mocker.patch('app.models.Category.query', side_effect=DBAPIError)


@pytest.fixture(scope='function')
Expand All @@ -199,7 +200,7 @@ def fake_language_query_error(mocker):
Mocks an exception being raised during a query to test error handling
"""

mocker.patch('app.models.Language.query', new=None)
mocker.patch('app.models.Language.query', side_effect=DBAPIError)


@pytest.fixture(scope='function')
Expand Down