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