Fix test_relative_local_nested_req_files

This commit is contained in:
Xavier Fernandez 2015-12-05 18:42:38 +01:00
parent e1e93520e5
commit c9b48feea6
2 changed files with 2 additions and 3 deletions

View File

@ -179,7 +179,6 @@ def process_line(line, filename, line_number, finder=None, comes_from=None,
# original file and nested file are paths
elif not SCHEME_RE.search(req_path):
# do a join so relative paths work
req_dir = os.path.dirname(filename)
req_path = os.path.join(os.path.dirname(filename), req_path)
# TODO: Why not use `comes_from='-r {} (line {})'` here as well?
parser = parse_requirements(

View File

@ -368,7 +368,7 @@ class TestProcessLine(object):
"""
Test a relative nested req file path is joined with the req file dir
"""
req_file = '/path/req_file.txt'
req_file = os.path.normpath('/path/req_file.txt')
def parse(*args, **kwargs):
return iter([])
@ -377,7 +377,7 @@ class TestProcessLine(object):
monkeypatch.setattr(pip.req.req_file, 'parse_requirements', mock_parse)
list(process_line("-r reqs.txt", req_file, 1, finder=finder))
call = mock_parse.mock_calls[0]
assert call[1][0] == '/path/reqs.txt'
assert call[1][0] == os.path.normpath('/path/reqs.txt')
def test_absolute_local_nested_req_files(self, finder, monkeypatch):
"""