@pytest.mark.network
def test_should_not_install_always_from_cache(script):
 script.pip('install', 'INITools==0.2', expect_error=True)
 script.pip('uninstall', '-y', 'INITools')
 result = script.pip('install', 'INITools==0.1', expect_error=True)
 assert (((script.site_packages / 'INITools-0.2-py%s.egg-info') % pyversion) not in result.files_created)
 assert (((script.site_packages / 'INITools-0.1-py%s.egg-info') % pyversion) in result.files_created)

@ pytest . mark . network def test_should_not_install_always_from_cache ( script ) : script . pip ( 'install' , 'INITools==0.2' , expect_error = True ) script . pip ( 'uninstall' , '-y' , 'INITools' ) result = script . pip ( 'install' , 'INITools==0.1' , expect_error = True ) assert ( ( ( script . site_packages / 'INITools-0.2-py%s.egg-info' ) % pyversion ) not in result . files_created ) assert ( ( ( script . site_packages / 'INITools-0.1-py%s.egg-info' ) % pyversion ) in result . files_created )
if there is an old cached package .