def test_correct_pip_version(script):
 result = script.pip('--version')
 dir = re.match('pip \\d(\\.[\\d])+(\\.?(rc|dev|pre|post)\\d+)? from (.*) \\(python \\d(.[\\d])+\\)$', result.stdout).group(4)
 pip_folder = join(SRC_DIR, 'pip')
 pip_folder_outputed = join(dir, 'pip')
 diffs = filecmp.dircmp(pip_folder, pip_folder_outputed)
 mismatch_py = [x for x in ((diffs.left_only + diffs.right_only) + diffs.diff_files) if x.endswith('.py')]
 assert (not mismatch_py), ('mismatched source files in %r and %r: %r' % (pip_folder, pip_folder_outputed, mismatch_py))

def test_correct_pip_version ( script ) : result = script . pip ( '--version' ) dir = re . match ( 'pip \\d(\\.[\\d])+(\\.?(rc|dev|pre|post)\\d+)? from (.*) \\(python \\d(.[\\d])+\\)$' , result . stdout ) . group ( 4 ) pip_folder = join ( SRC_DIR , 'pip' ) pip_folder_outputed = join ( dir , 'pip' ) diffs = filecmp . dircmp ( pip_folder , pip_folder_outputed ) mismatch_py = [ x for x in ( ( diffs . left_only + diffs . right_only ) + diffs . diff_files ) if x . endswith ( '.py' ) ] assert ( not mismatch_py ) , ( 'mismatched source files in %r and %r: %r' % ( pip_folder , pip_folder_outputed , mismatch_py ) )
check we are importing pip from the right place .