"""Pytest configuration module.""" import contextlib from flexmock import flexmock import pytest def fake_connection_execute(*args, **kwargs): """Function to be mocked and replace connection.execute().""" pass @pytest.fixture def get_fake_db_connection(): """Fixture with fake SQLAlchemy connection.""" @contextlib.contextmanager def fake_db_connection(*args, **kwargs): conn = flexmock(execute=fake_connection_execute) yield conn return fake_db_connection