Skip to content

Commit ed63b3d

Browse files
committed
Remove inconsistent test and fix filename write
1 parent 50202fd commit ed63b3d

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

tests/unit/test_req_file.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,10 @@ def test_recursive_requirements_file(
373373
list(parse_requirements(filename=str(req_files[0]), session=session))
374374

375375
# When one of other the requirements file recursively references itself
376-
req_files[req_file_count - 1].write_text(f"-r {req_files[req_file_count - 2]}")
376+
req_files[req_file_count - 1].write_text(
377+
# Just name since they are in the same folder
378+
f"-r {req_files[req_file_count - 2].name}"
379+
)
377380
with pytest.raises(
378381
RecursionError,
379382
match=(
@@ -386,7 +389,7 @@ def test_recursive_requirements_file(
386389
list(parse_requirements(filename=str(req_files[0]), session=session))
387390

388391
def test_recursive_relative_requirements_file(
389-
self, monkeypatch: pytest.MonkeyPatch, tmpdir: Path, session: PipSession
392+
self, tmpdir: Path, session: PipSession
390393
) -> None:
391394
root_req_file = tmpdir / "root.txt"
392395
(tmpdir / "nest" / "nest").mkdir(parents=True)
@@ -406,15 +409,6 @@ def test_recursive_relative_requirements_file(
406409
):
407410
list(parse_requirements(filename=str(root_req_file), session=session))
408411

409-
# If we don't use absolute path, it keeps on chaining the filename resulting in
410-
# a huge filename, since a != a/b/c/../../
411-
monkeypatch.setattr(os.path, "abspath", lambda x: x)
412-
with pytest.raises(
413-
pip._internal.exceptions.InstallationError,
414-
match="Could not open requirements file: .* File name too long:",
415-
):
416-
list(parse_requirements(filename=str(root_req_file), session=session))
417-
418412
def test_options_on_a_requirement_line(self, line_processor: LineProcessor) -> None:
419413
line = (
420414
'SomeProject --global-option="yo3" --global-option "yo4" '

0 commit comments

Comments
 (0)