tests.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:RSVPBot 作者: recursecenter 项目源码 文件源码
def devserver(port):
    config.rc_root = 'http://localhost:{}'.format(port)
    config.rc_api_root = config.rc_root + '/api/v1'

    proc = subprocess.Popen(
        ['python', 'devserver/__init__.py'],
        stdin=subprocess.DEVNULL,
        stdout=subprocess.DEVNULL,
        stderr=subprocess.DEVNULL,
        env={**os.environ, 'PORT': str(port)}
    )

    # wait for the dev server to come up
    time.sleep(1)

    try:
        yield
    finally:
        proc.kill()
        proc.wait()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号