summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-10-22 00:29:10 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-10-22 00:29:10 (GMT)
commit33a7fcc066367c39b0fbd5ccd3f6f084d6b5fb0a (patch)
treee1170c7c3fc67e420674e33c47f8d002677202ec /Lib
parent267597f087084283b5ad052d38cee9055d1acada (diff)
downloadcpython-33a7fcc066367c39b0fbd5ccd3f6f084d6b5fb0a.zip
cpython-33a7fcc066367c39b0fbd5ccd3f6f084d6b5fb0a.tar.gz
cpython-33a7fcc066367c39b0fbd5ccd3f6f084d6b5fb0a.tar.bz2
Issue #23981: Update test_unicodedata to use script_helpers
Patch by Christie.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_unicodedata.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index 0f33d19..6ecc913 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -9,8 +9,7 @@
import sys
import unittest
import hashlib
-import subprocess
-import test.support
+from test.support import script_helper
encoding = 'utf-8'
errors = 'surrogatepass'
@@ -234,16 +233,12 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
code = "import sys;" \
"sys.modules['unicodedata'] = None;" \
"""eval("'\\\\N{SOFT HYPHEN}'")"""
- args = [sys.executable, "-c", code]
- # We use a subprocess because the unicodedata module may already have
- # been loaded in this process.
- popen = subprocess.Popen(args, stderr=subprocess.PIPE)
- popen.wait()
- self.assertEqual(popen.returncode, 1)
+ # We use a separate process because the unicodedata module may already
+ # have been loaded in this process.
+ result = script_helper.assert_python_failure("-c", code)
error = "SyntaxError: (unicode error) \\N escapes not supported " \
"(can't load unicodedata module)"
- self.assertIn(error, popen.stderr.read().decode("ascii"))
- popen.stderr.close()
+ self.assertIn(error, result.err.decode("ascii"))
def test_decimal_numeric_consistent(self):
# Test that decimal and numeric are consistent,