Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 79e4803

Browse files
committed
remove test.support.have_unicode
1 parent 2b7411d commit 79e4803

4 files changed

Lines changed: 12 additions & 26 deletions

File tree

Doc/library/test.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,6 @@ The :mod:`test.test_support` module defines the following constants:
221221
:mod:`test.regrtest`.
222222

223223

224-
.. data:: have_unicode
225-
226-
:const:`True` when Unicode support is available.
227-
228-
229224
.. data:: is_jython
230225

231226
:const:`True` if the running interpreter is Jython.

Lib/test/README

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ test_support provides the following useful objects:
355355
mode, and it raises ``TestFailed`` on failure instead of
356356
``AssertionError``.
357357

358-
* ``have_unicode`` - true if Unicode is available, false otherwise.
359-
360358
* ``is_jython`` - true if the interpreter is Jython, false otherwise.
361359

362360
* ``TESTFN`` - a string that should always be used as the filename when

Lib/test/support.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"verbose", "use_resources", "max_memuse", "record_original_stdout",
1818
"get_original_stdout", "unload", "unlink", "rmtree", "forget",
1919
"is_resource_enabled", "requires", "find_unused_port", "bind_port",
20-
"fcmp", "have_unicode", "is_jython", "TESTFN", "HOST", "FUZZ",
21-
"findfile", "verify", "vereq", "sortdict", "check_syntax_error",
22-
"open_urlresource", "WarningMessage", "catch_warning", "CleanImport",
23-
"EnvironmentVarGuard", "TransientResource", "captured_output",
24-
"captured_stdout", "TransientResource", "transient_internet",
25-
"run_with_locale", "set_memlimit", "bigmemtest", "bigaddrspacetest",
26-
"BasicTestRunner", "run_unittest", "run_doctest", "threading_setup",
27-
"threading_cleanup", "reap_children"]
20+
"fcmp", "is_jython", "TESTFN", "HOST", "FUZZ", "findfile", "verify",
21+
"vereq", "sortdict", "check_syntax_error", "open_urlresource",
22+
"WarningMessage", "catch_warning", "CleanImport", "EnvironmentVarGuard",
23+
"TransientResource", "captured_output", "captured_stdout",
24+
"TransientResource", "transient_internet", "run_with_locale",
25+
"set_memlimit", "bigmemtest", "bigaddrspacetest", "BasicTestRunner",
26+
"run_unittest", "run_doctest", "threading_setup", "threading_cleanup",
27+
"reap_children"]
2828

2929
class Error(Exception):
3030
"""Base class for regression test exceptions."""
@@ -243,12 +243,6 @@ def fcmp(x, y): # fuzzy comparison function
243243
return (len(x) > len(y)) - (len(x) < len(y))
244244
return (x > y) - (x < y)
245245

246-
try:
247-
str
248-
have_unicode = True
249-
except NameError:
250-
have_unicode = False
251-
252246
is_jython = sys.platform.startswith('java')
253247

254248
# Filename used for testing

Lib/test/test_float.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ def test_float(self):
2222
self.assertRaises(ValueError, float, "+-3.14")
2323
self.assertRaises(ValueError, float, "-+3.14")
2424
self.assertRaises(ValueError, float, "--3.14")
25-
if have_unicode:
26-
self.assertEqual(float(unicode(" 3.14 ")), 3.14)
27-
self.assertEqual(float(unicode(" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14)
28-
# Implementation limitation in PyFloat_FromString()
29-
self.assertRaises(ValueError, float, unicode("1"*10000))
25+
self.assertEqual(float(unicode(" 3.14 ")), 3.14)
26+
self.assertEqual(float(unicode(" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14)
27+
# Implementation limitation in PyFloat_FromString()
28+
self.assertRaises(ValueError, float, unicode("1"*10000))
3029

3130
@support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
3231
def test_float_with_comma(self):

0 commit comments

Comments
 (0)