1
0
Fork 0
mirror of https://github.com/shouptech/flask-tutorial.git synced 2026-02-03 07:29:42 +00:00
flask-tutorial/tests/test_factory.py
Mike Shoup a6162261d9 Raise exception when variables are missing
Raises a ConfigError exception when configuration variables are missing.
2018-11-04 08:41:43 -07:00

19 lines
354 B
Python

import pytest
from flaskr import create_app
from flaskr.exceptions import ConfigError
@pytest.mark.parametrize('config', (
{},
{'SECRET_KEY':'test'}
))
def test_bad_config(config):
try:
create_app(config).testing
assert False
except ConfigError:
assert True
def test_good_config():
assert create_app(None)