def time_savings(tmpdir, between):
with tmpdir.as_cwd():<EOL><INDENT>enable_coverage()<EOL>@contextlib.contextmanager<EOL>def venv_setup():<EOL><INDENT>if not Path('<STR_LIT>').exists():<EOL><INDENT>requirements('<STR_LIT>')<EOL>venv_update()<EOL><DEDENT>install_coverage()<EOL>requirements('<STR_LIT:\n>'.join((<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'<EOL>)))<EOL>yield<EOL>expected = '<STR_LIT:\n>'.join((<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>' % __version__,<EOL>'<STR_LIT>'<EOL>))<EOL>assert pip_freeze() == expected<EOL><DEDENT>from time import time<EOL>with venv_setup():<EOL><INDENT>start = time()<EOL>venv_update(<EOL>PIP_VERBOSE='<STR_LIT:1>',<EOL>PIP_RETRIES='<STR_LIT:0>',<EOL>PIP_TIMEOUT='<STR_LIT:0>',<EOL>)<EOL>time1 = time() - start<EOL><DEDENT>between()<EOL>with venv_setup():<EOL><INDENT>start = time()<EOL>venv_update(<EOL>PIP_VERBOSE='<STR_LIT:1>',<EOL>PIP_RETRIES='<STR_LIT:0>',<EOL>PIP_TIMEOUT='<STR_LIT:0>',<EOL>http_proxy='<STR_LIT>',<EOL>https_proxy='<STR_LIT>',<EOL>ftp_proxy='<STR_LIT>',<EOL>)<EOL>time2 = time() - start<EOL><DEDENT>print()<EOL>print('<STR_LIT>' % time1)<EOL>print('<STR_LIT>' % time2)<EOL>difference = time1 - time2<EOL>print('<STR_LIT>' % difference)<EOL>ratio = time1 / time2<EOL>percent = (ratio - <NUM_LIT:1>) * <NUM_LIT:100><EOL>print('<STR_LIT>' % percent)<EOL>return difference<EOL><DEDENT>
install twice, and the second one should be faster, due to whl caching