def METHOD_NAME(tmpdir):
    """Test ProjectContext object."""
    project_context = ProjectContext()
    with pytest.raises(errors.ProjectContextError):
        _ = project_context.path
    with pytest.raises(IndexError):
        project_context.pop_context()
    path = Path(tmpdir.mkdir("push"))
    project_context.push_path(path)
    assert project_context.path == path
    assert project_context.pop_context().path == path
    project_context.replace_path(path)
    assert project_context.path == path
    assert project_context.pop_context().path == path
    with pytest.raises(IndexError):
        project_context.pop_context()
    new_path = Path(tmpdir.mkdir("new"))
    with project_context.with_path(new_path):
        assert project_context.path == new_path
    with pytest.raises(errors.ProjectContextError):
        _ = project_context.path