File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -521,6 +521,7 @@ def test_pip_package(host):
521
521
outdated = host .pip_package .get_outdated_packages (pip_path = "/v/bin/pip" )["pytest" ]
522
522
assert outdated ["current" ] == pytest ["version" ]
523
523
assert int (outdated ["latest" ].split ("." )[0 ]) > 2
524
+ assert host .pip_package .check ().succeeded
524
525
525
526
526
527
def test_environment_home (host ):
Original file line number Diff line number Diff line change @@ -26,6 +26,24 @@ def _re_match(line, regexp):
26
26
class PipPackage (InstanceModule ):
27
27
"""Test pip packages status and version"""
28
28
29
+ def check (self , pip_path = "pip" ):
30
+ """Verify installed packages have compatible dependencies.
31
+
32
+ >>> cmd = host.pip_package.check()
33
+ >>> cmd.rc
34
+ 0
35
+ >>> cmd.stdout
36
+ No broken requirements found.
37
+
38
+ Can only be used if `pip check`_ command is available,
39
+ for pip versions >= 9.0.0_.
40
+
41
+ .. _pip check: https://pip.pypa.io/en/stable/reference/pip_check/
42
+ .. _9.0.0: https://pip.pypa.io/en/stable/news/#id526
43
+ """
44
+ cmd = "{} check" .format (pip_path )
45
+ return self .run_expect ([0 , 1 ], cmd )
46
+
29
47
def get_packages (self , pip_path = "pip" ):
30
48
"""Get all installed packages and versions returned by `pip list`:
31
49
You can’t perform that action at this time.
0 commit comments