def test_hashfile(tmpdir, algo, digest): f = tmpdir.join("empty") f.ensure() assert core.digest_file(f.strpath, algo) == digest