milvus/shards/conftest.py

28 lines
411 B
Python
Raw Normal View History

2019-10-21 08:21:32 +00:00
import logging
import pytest
import grpc
from mishards import settings, db, create_app
logger = logging.getLogger(__name__)
@pytest.fixture
def app(request):
app = create_app(settings.TestingConfig)
db.drop_all()
db.create_all()
yield app
db.drop_all()
@pytest.fixture
def started_app(app):
app.on_pre_run()
app.start(settings.SERVER_TEST_PORT)
yield app
app.stop()