push
This commit is contained in:
19
tests/conftest.py
Normal file
19
tests/conftest.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import os
|
||||
import pytest
|
||||
from mikromon import create_app, db
|
||||
|
||||
@pytest.fixture()
|
||||
def app(tmp_path):
|
||||
os.environ["DATABASE_URL"] = f"sqlite:///{tmp_path/'test.db'}"
|
||||
os.environ["DEV_INPROCESS_POLLER"] = "0"
|
||||
os.environ["SECRET_KEY"] = "test-secret"
|
||||
# Fernet key
|
||||
os.environ["CRED_ENC_KEY"] = "WmQxY2pKQ0FqV0lJdVFSWFBzYlJKUTZkdmJpZGFjY0k=" # dummy base64, will fail if used; tests avoid decrypt
|
||||
app = create_app()
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
yield app
|
||||
|
||||
@pytest.fixture()
|
||||
def client(app):
|
||||
return app.test_client()
|
||||
Reference in New Issue
Block a user