Commit 030af110 by Sébastien Eustace

Improve to pip freeze call in InstalledRepository

parent 72c96a81
...@@ -16,7 +16,7 @@ class InstalledRepository(Repository): ...@@ -16,7 +16,7 @@ class InstalledRepository(Repository):
""" """
repo = cls() repo = cls()
freeze_output = env.run("pip", "freeze") freeze_output = env.run("python", "-m", "pip", "freeze")
for line in freeze_output.split("\n"): for line in freeze_output.split("\n"):
if "==" in line: if "==" in line:
name, version = re.split("={2,3}", line) name, version = re.split("={2,3}", line)
......
...@@ -10,10 +10,10 @@ orator===0.9.8 ...@@ -10,10 +10,10 @@ orator===0.9.8
class MockEnv(BaseMockEnv): class MockEnv(BaseMockEnv):
def run(self, bin, *args): def run(self, bin, *args):
if bin == "pip" and args[0] == "freeze": if bin == "python" and args[:3] == ("-m", "pip", "freeze"):
return FREEZE_RESULTS return FREEZE_RESULTS
super(MockEnv, self).run(bin, *args) return super(MockEnv, self).run(bin, *args)
def test_load(): def test_load():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment