コード例 #1
0
def app(nbdime_base_url, filespath):
    """This is a fixture used by the pytest-tornado plugin.

    It is indirectly called by all tests that use the `gen_test`
    test mark.
    """
    return init_app(
        base_url=nbdime_base_url,
        port=0,
        cwd=filespath,
    )
コード例 #2
0
ファイル: conftest.py プロジェクト: vidartf/nbdime
def app(nbdime_base_url, filespath):
    """This is a fixture used by the pytest-tornado plugin.

    It is indirectly called by all tests that use the `gen_test`
    test mark.
    """
    from nbdime.webapp.nbdimeserver import init_app
    return init_app(
        base_url=nbdime_base_url,
        port=0,
        cwd=filespath,
    )[0]
コード例 #3
0
def run_server_bg(fbase, fremote, q):
    asyncio.set_event_loop(asyncio.new_event_loop())
    io_loop = ioloop.IOLoop.current(instance=True)
    app, server = init_app(
        on_port=lambda port: q.put(port),
        closable=True,
        difftool_args=dict(base=fbase, remote=fremote),
    )
    io_loop.start()
    # After ioloop ends, clean up after server:
    server.stop()
    q.put(app.exit_code)
コード例 #4
0
ファイル: conftest.py プロジェクト: AlexxNica/nbdime
def app(nbdime_base_url, filespath):
    return init_app(
        base_url=nbdime_base_url,
        port=0,
        cwd=filespath,
    )