def test_branch_throw(tmpdir, repo): with pytest.raises(ValueError): with branch('a', repo=repo): raise ValueError
def test_branch(tmpdir, repo): with branch('a', repo=repo): with pushd(tmpdir.strpath): with open('test') as f: assert f.read() == first_commit_file_content