2020-08-20 17:08:02 +00:00
|
|
|
From c596ad546fe7460b57a62799837757eb641309c1 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Sirio Balmelli <sirio@b-ad.ch>
|
|
|
|
Date: Mon, 20 Jul 2020 19:51:20 +0200
|
|
|
|
Subject: [PATCH] Disable tests that fail on Darwin (macOS) or with sandboxing
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
Signed-off-by: Sirio Balmelli <sirio@b-ad.ch>
|
2020-04-24 23:36:52 +00:00
|
|
|
--- a/test.py
|
|
|
|
+++ b/test.py
|
2021-10-06 13:57:05 +00:00
|
|
|
@@ -377,6 +377,7 @@ exit(3)
|
2020-04-24 23:36:52 +00:00
|
|
|
self.assertEqual(sed(_in="one test three", e="s/test/two/").strip(),
|
2020-08-20 17:08:02 +00:00
|
|
|
"one two three")
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
+ @not_macos
|
2020-04-24 23:36:52 +00:00
|
|
|
def test_ok_code(self):
|
|
|
|
from sh import ls, ErrorReturnCode_1, ErrorReturnCode_2
|
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
@@ -982,6 +983,7 @@ print(sys.argv[1])
|
2020-08-20 17:08:02 +00:00
|
|
|
now = time.time()
|
|
|
|
self.assertGreater(now - start, sleep_time)
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
+ @not_macos
|
2020-04-24 23:36:52 +00:00
|
|
|
def test_background_exception(self):
|
|
|
|
from sh import ls, ErrorReturnCode_1, ErrorReturnCode_2
|
2020-08-20 17:08:02 +00:00
|
|
|
p = ls("/ofawjeofj", _bg=True, _bg_exc=False) # should not raise
|
2021-10-06 13:57:05 +00:00
|
|
|
@@ -1779,6 +1781,7 @@ exit(49)
|
2020-08-20 17:08:02 +00:00
|
|
|
p = python(py.name, _ok_code=49, _bg=True)
|
|
|
|
self.assertEqual(49, p.exit_code)
|
|
|
|
|
|
|
|
+ @not_macos
|
|
|
|
def test_cwd(self):
|
|
|
|
from sh import pwd
|
|
|
|
from os.path import realpath
|
2021-10-06 13:57:05 +00:00
|
|
|
@@ -2777,6 +2780,7 @@ print("cool")
|
|
|
|
# on osx. so skip it for now if osx
|
|
|
|
@not_macos
|
|
|
|
@requires_progs("lsof")
|
|
|
|
+ @skipUnless(False, "Flaky on Hydra")
|
|
|
|
def test_no_fd_leak(self):
|
|
|
|
import sh
|
|
|
|
import os
|
|
|
|
@@ -2879,6 +2883,7 @@ print("hi")
|
2020-08-20 17:08:02 +00:00
|
|
|
python(py.name, _in=stdin)
|
|
|
|
|
|
|
|
@requires_utf8
|
|
|
|
+ @skipUnless(False, "Does not work in sandbox")
|
|
|
|
def test_unicode_path(self):
|
|
|
|
from sh import Command
|
2020-04-24 23:36:52 +00:00
|
|
|
|