test_cli.py 文件源码

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

项目:client 作者: wandb 项目源码 文件源码
def test_push_dirty_force_git(runner, request_mocker, query_project, upload_url, upsert_run, monkeypatch):
    query_project(request_mocker)
    upload_url(request_mocker)
    update_mock = upsert_run(request_mocker)
    with runner.isolated_filesystem():
        # So GitRepo is in this cwd
        monkeypatch.setattr(cli, 'api', wandb_api.Api({'project': 'test'}))
        repo = git_repo()
        with open('weights.h5', 'wb') as f:
            f.write(os.urandom(100))
        repo.repo.index.add(["weights.h5"])
        result = runner.invoke(
            cli.push, ["test", "weights.h5", "-f", "-p", "test", "-m", "Dirty"])
        print(result.output)
        print(result.exception)
        print(traceback.print_tb(result.exc_info[2]))
        assert result.exit_code == 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号