diff options
Diffstat (limited to 'dev-python/sh/files/sh-1.14.0-fix-sleep-test.patch')
-rw-r--r-- | dev-python/sh/files/sh-1.14.0-fix-sleep-test.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/dev-python/sh/files/sh-1.14.0-fix-sleep-test.patch b/dev-python/sh/files/sh-1.14.0-fix-sleep-test.patch new file mode 100644 index 000000000000..28d1ec9847fd --- /dev/null +++ b/dev-python/sh/files/sh-1.14.0-fix-sleep-test.patch @@ -0,0 +1,33 @@ +From 83b189de4f461ed0370b0472f1938d3162ed00c7 Mon Sep 17 00:00:00 2001 +From: David Runge <dave@sleepmap.de> +Date: Tue, 1 Sep 2020 23:18:13 +0200 +Subject: [PATCH] Remove hardcoded path for sleep executable + +test.py: +In test_timeout the path for the sleep executable has been hardcoded to +be /bin/sleep. However, on operating systems such as Arch Linux, Fedora +or Solaris the executable resides in /usr/bin/sleep due to a /usr merge +(e.g. see + https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/). +By only checking for the name of the executable and its parameter the +test becomes more generic and thus can run on any (Unix-like) operating +system (given that `sleep` is in PATH). + +Fixes #539 +--- + test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test.py b/test.py +index f8029c04..142fcc0d 100644 +--- a/test.py ++++ b/test.py +@@ -2014,7 +2014,7 @@ def test_timeout(self): + try: + sh.sleep(sleep_for, _timeout=timeout).wait() + except sh.TimeoutException as e: +- self.assertEqual(e.full_cmd, '/bin/sleep 3') ++ assert 'sleep 3' in e.full_cmd + else: + self.fail("no timeout exception") + elapsed = time() - started |