def app(): """An application for the tests.""" _app = create_app(config=TestConfig) ctx = _app.test_request_context() ctx.push() try: yield _app finally: ctx.pop()
def api(): """An api instance for the tests, no manager""" import os # the mere presence of the env var should prevent the manage # blueprint from being registered os.environ['POLYLOGYX_NO_MANAGER'] = '1' _app = create_app(config=TestConfig) ctx = _app.test_request_context() ctx.push() try: yield _app finally: ctx.pop()
# -*- coding: utf-8 -*- from polylogyx.application import create_app from polylogyx.settings import CurrentConfig from polylogyx.tasks import pull_and_match_with_rules import threading app = create_app(config=CurrentConfig) thread_count = 5 for i in range(thread_count): t = threading.Thread(target=pull_and_match_with_rules) t.start()