diff --git a/fix-test_general_signal.diff b/fix-test_general_signal.diff new file mode 100644 index 0000000..7405ab1 --- /dev/null +++ b/fix-test_general_signal.diff @@ -0,0 +1,34 @@ +Index: sh-1.12.14/test.py +=================================================================== +--- sh-1.12.14.orig/test.py ++++ sh-1.12.14/test.py +@@ -1374,10 +1374,9 @@ for i in range(5): + self.assertTrue("4" not in stdout) + + def test_general_signal(self): +- import signal + from signal import SIGINT + +- py = create_tmp_test(""" ++ py = create_tmp_test(r""" + import sys + import os + import time +@@ -1386,7 +1385,7 @@ import signal + def sig_handler(sig, frame): + print(10) + exit(0) +- ++ + signal.signal(signal.SIGINT, sig_handler) + + for i in range(5): +@@ -1403,7 +1402,7 @@ for i in range(5): + process.signal(SIGINT) + return True + +- p = python(py.name, _out=agg, _tee=True) ++ p = python('-u', py.name, _out=agg, _tee=True) + p.wait() + + self.assertEqual(p.process.exit_code, 0) diff --git a/fix-test_signal_group.diff b/fix-test_signal_group.diff new file mode 100644 index 0000000..8a0f1f9 --- /dev/null +++ b/fix-test_signal_group.diff @@ -0,0 +1,20 @@ +Index: sh-1.12.14/test.py +=================================================================== +--- sh-1.12.14.orig/test.py ++++ sh-1.12.14/test.py +@@ -1,4 +1,4 @@ +-# -*- coding: utf8 -*- ++# -*- coding: utf-8 -*- + import sys + import os + +@@ -2048,7 +2048,8 @@ time.sleep(3) + """) + + parent = create_tmp_test(""" +-import sys ++import os, sys ++sys.path.insert(0, os.getcwd()) + import sh + system_python = sh.Command(sh.which("python%d.%d" % sys.version_info[:2])) + p = system_python("{child_file}", _bg=True, _new_session=False) diff --git a/python-sh.changes b/python-sh.changes index 9f811fb..a558841 100644 --- a/python-sh.changes +++ b/python-sh.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon May 27 11:59:53 UTC 2019 - Alberto Planas Dominguez + +- Add patches to fix some tests: + * fix-test_signal_group.diff + * fix-test_general_signal.diff (bsc#1120329) + ------------------------------------------------------------------- Fri Feb 1 13:16:33 UTC 2019 - Tomáš Chvátal diff --git a/python-sh.spec b/python-sh.spec index 979a7ca..cb675bc 100644 --- a/python-sh.spec +++ b/python-sh.spec @@ -29,6 +29,8 @@ Patch0: always-use-fully-versioned-python-command-in-tests.patch Patch1: no-coverage.patch Patch2: 0001-Fix-tests-for-the-drop-the-unversion-python.patch Patch3: pep-0538-test-fix.patch +Patch4: fix-test_signal_group.diff +Patch5: fix-test_general_signal.diff BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros BuildArch: noarch