Skip to content

Commit

Permalink
Factored DOS-newline-handling into test_pip.py; since it applies ever…
Browse files Browse the repository at this point in the history
…ywhere now, that should fix the last of the Windows failures!
  • Loading branch information
dabrahams committed May 3, 2010
1 parent 811ca64 commit 00a4196
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_basic.py
Expand Up @@ -17,7 +17,7 @@ def test_correct_pip_version():

# compare the directory tree of the invoked pip with that of this source distribution
import re,filecmp
dir = re.match(r'\s*pip\s\S+\sfrom\s+(.*)\s\([^(]+\)$', result.stdout.replace('\r\n','\n')).group(1)
dir = re.match(r'\s*pip\s\S+\sfrom\s+(.*)\s\([^(]+\)$', result.stdout).group(1)
diffs = filecmp.dircmp(join(base,'pip'), join(dir,'pip'))

# If any non-matching .py files exist, we have a problem: run_pip
Expand Down
2 changes: 1 addition & 1 deletion tests/test_freeze.py
Expand Up @@ -32,7 +32,7 @@ def test_freeze():
INITools==0.2
simplejson==1.7.4...
<BLANKLINE>""")
assert checker.check_output(expected, str(result), ELLIPSIS), result
assert checker.check_output(expected, str(result), ELLIPSIS), [expected,str(result)]

# Now lets try it with an svn checkout::
result = env.run('svn', 'co', '-r3472', 'http://svn.colorstudy.com/INITools/trunk', 'initools-trunk')
Expand Down
9 changes: 9 additions & 0 deletions tests/test_pip.py 100755 → 100644
Expand Up @@ -106,6 +106,15 @@ def __getattr__(self, attr):
def __str__(self):
return str(self._impl)

if sys.platform == 'win32':
@property
def stdout(self):
return self._impl.stdout.replace('\r\n', '\n')

@property
def stderr(self):
return self._impl.stderr.replace('\r\n', '\n')

def assert_installed(self, pkg_name, with_files=[], without_files=[], without_egg_link=False):
e = self.test_env

Expand Down

0 comments on commit 00a4196

Please sign in to comment.