conftest.py 文件源码

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

项目:scarlett_os 作者: bossjones 项目源码 文件源码
def setup_environment():
    # source: http://stackoverflow.com/questions/17278650/python-3-script-using-libnotify-fails-as-cron-job  # noqa
    if 'TRAVIS_CI' in os.environ:
        if 'DISPLAY' not in os.environ:
            # TODO: Should this be on :99 ?
            os.environ['DISPLAY'] = ':0'

    if 'DBUS_SESSION_BUS_ADDRESS' not in os.environ:
        print('NOTE: DBUS_SESSION_BUS_ADDRESS environment var not found!')

    # Setup an environment for the fixtures to share so the bus address is the same for all  # noqa
    environment = environ.copy()

    # Setup an environment for the fixtures to share so the bus address is the same for all
    environment["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=" + OUTSIDE_SOCKET

    print("[DBUS_SESSION_BUS_ADDRESS]: {}".format(environment["DBUS_SESSION_BUS_ADDRESS"]))
    return environment
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号