@pytest.mark.network
def test_double_install_spurious_hash_mismatch(script, tmpdir):
 script.pip('install', 'wheel')
 with requirements_file('simple==1.0 --hash=sha256:393043e672415891885c9a2a0929b1af95fb866d6ca016b42d2e6ce53619b653', tmpdir) as reqs_file:
  result = script.pip_install_local('-r', reqs_file.abspath, expect_error=False)
  assert ('Successfully installed simple-1.0' in str(result))
  script.pip('uninstall', '-y', 'simple', expect_error=False)
  result = script.pip_install_local('-r', reqs_file.abspath, expect_error=False)
  assert ('Successfully installed simple-1.0' in str(result))

@ pytest . mark . network def test_double_install_spurious_hash_mismatch ( script , tmpdir ) : script . pip ( 'install' , 'wheel' ) with requirements_file ( 'simple==1.0 --hash=sha256:393043e672415891885c9a2a0929b1af95fb866d6ca016b42d2e6ce53619b653' , tmpdir ) as reqs_file : result = script . pip_install_local ( '-r' , reqs_file . abspath , expect_error = False ) assert ( 'Successfully installed simple-1.0' in str ( result ) ) script . pip ( 'uninstall' , '-y' , 'simple' , expect_error = False ) result = script . pip_install_local ( '-r' , reqs_file . abspath , expect_error = False ) assert ( 'Successfully installed simple-1.0' in str ( result ) )
make sure installing the same hashed sdist twice doesnt throw hash mismatch errors .