mirror of
https://github.com/veops/cmdb.git
synced 2025-08-08 10:48:59 +08:00
升级后端并开源UI
This commit is contained in:
24
tests/conftest.py
Normal file
24
tests/conftest.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Defines fixtures available to all tests."""
|
||||
|
||||
import pytest
|
||||
from webtest import TestApp
|
||||
|
||||
from api.app import create_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
"""Create application for the tests."""
|
||||
_app = create_app("tests.settings")
|
||||
ctx = _app.test_request_context()
|
||||
ctx.push()
|
||||
yield _app
|
||||
|
||||
ctx.pop()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def testapp(app):
|
||||
"""Create Webtest app."""
|
||||
return TestApp(app)
|
Reference in New Issue
Block a user