From 0170fdf7d1ce60ebc2c03cd92db9cea424aef3d4 Mon Sep 17 00:00:00 2001 From: Ethan Smith Date: Tue, 10 Apr 2018 17:01:07 -0700 Subject: [PATCH] Report if uninstall of package in pep561 tests failed --- mypy/test/testpep561.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mypy/test/testpep561.py b/mypy/test/testpep561.py index 5d2e3a5963e3..f67b37d6043e 100644 --- a/mypy/test/testpep561.py +++ b/mypy/test/testpep561.py @@ -48,7 +48,10 @@ def install_package(self, pkg: str, try: yield finally: - run_command([python_executable, '-m', 'pip', 'uninstall', '-y', pkg], cwd=package_path) + returncode, lines = run_command([python_executable, '-m', 'pip', 'uninstall', + '-y', pkg], cwd=package_path) + if returncode != 0: + self.fail('\n'.join(lines)) def test_get_pkg_dirs(self) -> None: """Check that get_package_dirs works."""