mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-11 13:08:34 +03:00
setting env vars for tests
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import pytest
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
from sqlalchemy import create_engine
|
||||
|
||||
# from sqlalchemy_utils import create_database, database_exists, drop_database
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_logger_add():
|
||||
@@ -11,7 +8,6 @@ def mock_logger_add():
|
||||
with patch('loguru.logger.add') as mock_add:
|
||||
yield mock_add # This makes the mock available to tests
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_database_url():
|
||||
with patch('core.config.SQLALCHEMY_DATABASE_URL', "sqlite:////app/auto-archiver.test.db") as mock_wb_url:
|
||||
yield mock_wb_url
|
||||
os.environ["CHROME_APP_IDS"] = 'test_app_id_1,test_app_id_2'
|
||||
os.environ["DATABASE_PATH"] = "sqlite:////app/auto-archiver.test.db"
|
||||
os.environ["BLOCKED_EMAILS"] = "blocked@example.com"
|
||||
Reference in New Issue
Block a user