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
评论列表
文章目录