fix create_app import in tests
This commit is contained in:
parent
fa282b96e0
commit
316cf7e581
@ -2,10 +2,11 @@ import os
|
|||||||
|
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
import pytest
|
import pytest
|
||||||
import importlib
|
|
||||||
import yaml
|
import yaml
|
||||||
from flask.testing import FlaskClient
|
from flask.testing import FlaskClient
|
||||||
|
|
||||||
|
from app.app import create_app
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def temp_config(tmpdir) -> str:
|
def temp_config(tmpdir) -> str:
|
||||||
@ -43,8 +44,7 @@ def temp_config(tmpdir) -> str:
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def flask_app(temp_config) -> Flask:
|
def flask_app(temp_config) -> Flask:
|
||||||
os.environ['WEBPUB1C_CONFIG'] = temp_config
|
os.environ['WEBPUB1C_CONFIG'] = temp_config
|
||||||
pub1c = importlib.import_module('run')
|
return create_app()
|
||||||
return pub1c.app
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
Loading…
Reference in New Issue
Block a user