Accepting request 705683 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/705683 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-sh?expand=0&rev=6
This commit is contained in:
commit
2011cb1e8b
34
fix-test_general_signal.diff
Normal file
34
fix-test_general_signal.diff
Normal file
@ -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)
|
20
fix-test_signal_group.diff
Normal file
20
fix-test_signal_group.diff
Normal file
@ -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)
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon May 27 11:59:53 UTC 2019 - Alberto Planas Dominguez <aplanas@suse.com>
|
||||
|
||||
- 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 <tchvatal@suse.com>
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user