Skip to content

Commit 64967c7

Browse files
committed
Fix test_install_requirements_with_options
This test depended on setup.py install, and tbh, I don't see a good reason to attempt an install when testing the requirements file parser.
1 parent bc3feef commit 64967c7

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

tests/unit/test_req_file.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import collections
22
import logging
33
import os
4-
import subprocess
54
import textwrap
65
from optparse import Values
76
from pathlib import Path
@@ -880,14 +879,4 @@ def test_install_requirements_with_options(
880879
)
881880
)
882881

883-
req.source_dir = os.curdir
884-
with mock.patch.object(subprocess, "Popen") as popen:
885-
popen.return_value.stdout.readline.return_value = b""
886-
try:
887-
req.install([])
888-
except Exception:
889-
pass
890-
891-
last_call = popen.call_args_list[-1]
892-
args = last_call[0][0]
893-
assert 0 < args.index(global_option) < args.index("install")
882+
assert req.global_options == [global_option]

0 commit comments

Comments
 (0)