def before_all(context):
    aiohttpretty.activate()

    logger = logging.getLogger(requests.__name__)
    logger.setLevel(logging.ERROR)
    context.base_url = 'http://localhost:{}'.format(settings.PORT)
    context.server_thread = ServerThread()
    context.server_thread.start()
    for _ in range(5):
        try:
            requests.get(context.base_url)
            break
        except requests.exceptions.ConnectionError:
            time.sleep(5)
    else:
        raise Exception('Unable to connect to testing server at {}'.format(context.base_url))
Exemple #2
0
def before_all(context):
    aiohttpretty.activate()

    logger = logging.getLogger(requests.__name__)
    logger.setLevel(logging.ERROR)
    context.base_url = 'http://localhost:{}'.format(settings.PORT)
    context.server_thread = ServerThread()
    context.server_thread.start()
    for _ in range(5):
        try:
            requests.get(context.base_url)
            break
        except requests.exceptions.ConnectionError:
            time.sleep(5)
    else:
        raise Exception('Unable to connect to testing server at {}'.format(
            context.base_url))
def pytest_runtest_setup(item):
    if 'aiohttpretty' in item.keywords:
        aiohttpretty.clear()
        aiohttpretty.activate()
Exemple #4
0
def pytest_runtest_setup(item):
    marker = item.get_marker('aiohttpretty')
    if marker is not None:
        aiohttpretty.clear()
        aiohttpretty.activate()
Exemple #5
0
def pytest_runtest_setup(item):
    marker = item.get_marker('aiohttpretty')
    if marker is not None:
        aiohttpretty.clear()
        aiohttpretty.activate()