Kaydet (Commit) 83d6a87a authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Merged revisions 65237 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65237 | antoine.pitrou | 2008-07-25 22:40:19 +0200 (ven., 25 juil. 2008) | 3 lines

  convert test_locale to unittest, and add a mechanism to override localconv() results for further testing (#1864, #1222)
........
üst 6e1df8d0
......@@ -13,6 +13,7 @@
import sys, encodings, encodings.aliases
from builtins import str as _builtin_str
import functools
# Try importing the _locale module.
#
......@@ -94,6 +95,21 @@ if 'strxfrm' not in globals():
if 'strcoll' not in globals():
strcoll = _strcoll
_localeconv = localeconv
# With this dict, you can override some items of localeconv's return value.
# This is useful for testing purposes.
_override_localeconv = {}
@functools.wraps(_localeconv)
def localeconv():
d = _localeconv()
if _override_localeconv:
d.update(_override_localeconv)
return d
### Number formatting APIs
# Author: Martin von Loewis
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment