Skip to content

Commit 30a89e2

Browse files
committed
add MONGO_URI in conf tests
1 parent 5a82462 commit 30a89e2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

backend/tests/conftest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,26 @@
22
import os
33
import pytest
44

5+
56
# Adiciona o diretório 'backend' ao caminho de importação do Python
67
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
78

89
from log_config import setup_test_logging
10+
from config import Config
11+
from app import create_app
12+
13+
@pytest.fixture
14+
def app():
15+
app = create_app()
16+
app.config.update({
17+
"TESTING": True,
18+
"MONGO_URI": Config.MONGO_URI
19+
})
20+
return app
21+
22+
@pytest.fixture
23+
def client(app):
24+
return app.test_client()
925

1026
@pytest.fixture(autouse=True)
1127
def log_tests(request):

0 commit comments

Comments
 (0)