@pytest.mark.network
def test_cleanup_prevented_upon_build_dir_exception(script, data):
 build = (script.venv_path / 'build')
 build_simple = (build / 'simple')
 os.makedirs(build_simple)
 write_delete_marker_file(build)
 build_simple.join('setup.py').write('#')
 result = script.pip('install', '-f', data.find_links, '--no-index', 'simple', '--build', build, expect_error=True)
 assert (result.returncode == PREVIOUS_BUILD_DIR_ERROR)
 assert ("pip can't proceed" in result.stderr)
 assert exists(build_simple)

@ pytest . mark . network def test_cleanup_prevented_upon_build_dir_exception ( script , data ) : build = ( script . venv_path / 'build' ) build_simple = ( build / 'simple' ) os . makedirs ( build_simple ) write_delete_marker_file ( build ) build_simple . join ( 'setup.py' ) . write ( '#' ) result = script . pip ( 'install' , '-f' , data . find_links , '--no-index' , 'simple' , '--build' , build , expect_error = True ) assert ( result . returncode == PREVIOUS_BUILD_DIR_ERROR ) assert ( "pip can't proceed" in result . stderr ) assert exists ( build_simple )
test no cleanup occurs after a previousbuilddirerror .