2019-03-24 19:12:17 +08:00

17 lines
475 B
Python

import pytest
from flask import Flask
from engine import app
@pytest.fixture(scope='module')
def test_client():
# Flask provides a way to test your application by exposing the Werkzeug test Client
# and handling the context locals for you.
testing_client = app.test_client()
# Establish an application context before running the tests.
ctx = app.app_context()
ctx.push()
yield testing_client # this is where the testing happens!
ctx.pop()