mirror of https://github.com/pypa/pip
Fix test_relative_local_nested_req_files
This commit is contained in:
parent
e1e93520e5
commit
c9b48feea6
|
@ -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(
|
||||
|
|
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue