From cbaacf58d881a876fcaeef999ca361591f2976fa Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Wed, 31 Aug 2016 17:06:17 -0300 Subject: [PATCH] selftests/unit/test_utils_partition.py: also treat raised OSError When skipping tests due to the lack of sudo permissions, OSError can be raised when the asked binary does not exist and can not be executed. In an ideal world, only one "skip" decorator would have to run, and this extra treatment wouldn't be necessary since there's already a `missing_binary` being used. Unfortunately, that's not how they work. Signed-off-by: Cleber Rosa --- selftests/unit/test_utils_partition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selftests/unit/test_utils_partition.py b/selftests/unit/test_utils_partition.py index 76680457..8efad11d 100644 --- a/selftests/unit/test_utils_partition.py +++ b/selftests/unit/test_utils_partition.py @@ -33,7 +33,7 @@ def cannot_sudo(command): try: process.run(command, sudo=True) False - except process.CmdError: + except (process.CmdError, OSError): return True -- GitLab