forked from pool/python-sh
* always-use-fully-versioned-python-command-in-tests.patch * no-coverage.patch * 0001-Fix-tests-for-the-drop-the-unversion-python.patch * pep-0538-test-fix.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sh?expand=0&rev=18
51 lines
1.4 KiB
Diff
51 lines
1.4 KiB
Diff
diff -Naurp sh-1.12.14.orig/test.py sh-1.12.14/test.py
|
|
--- sh-1.12.14.orig/test.py 2017-06-06 21:51:42.000000000 -0500
|
|
+++ sh-1.12.14/test.py 2017-06-07 11:27:04.912212886 -0500
|
|
@@ -515,17 +515,28 @@ while True:
|
|
"VERSIONER_PYTHON_VERSION",
|
|
]
|
|
|
|
+ # Fedora adds some extra environment variables as well.
|
|
+ # See https://www.python.org/dev/peps/pep-0538/ for more info.
|
|
+ fedora_cruft = [
|
|
+ "LC_CTYPE",
|
|
+ "LANG"
|
|
+ ]
|
|
+
|
|
# first we test that the environment exists in our child process as
|
|
# we've set it
|
|
py = create_tmp_test("""
|
|
import os
|
|
|
|
osx_cruft = %s
|
|
+fedora_cruft = %s
|
|
for key in osx_cruft:
|
|
try: del os.environ[key]
|
|
except: pass
|
|
+for key in fedora_cruft:
|
|
+ try: del os.environ[key]
|
|
+ except: pass
|
|
print(os.environ["HERP"] + " " + str(len(os.environ)))
|
|
-""" % osx_cruft)
|
|
+""" % (osx_cruft, fedora_cruft))
|
|
out = python(py.name, _env=env).strip()
|
|
self.assertEqual(out, "DERP 1")
|
|
|
|
@@ -534,11 +545,15 @@ import os, sys
|
|
sys.path.insert(0, os.getcwd())
|
|
import sh
|
|
osx_cruft = %s
|
|
+fedora_cruft = %s
|
|
for key in osx_cruft:
|
|
try: del os.environ[key]
|
|
except: pass
|
|
+for key in fedora_cruft:
|
|
+ try: del os.environ[key]
|
|
+ except: pass
|
|
print(sh.HERP + " " + str(len(os.environ)))
|
|
-""" % osx_cruft)
|
|
+""" % (osx_cruft, fedora_cruft))
|
|
out = python(py.name, _env=env, _cwd=THIS_DIR).strip()
|
|
self.assertEqual(out, "DERP 1")
|
|
|