[Python-checkins] cpython (2.7): Issue #20086: Output more details when test_getsetlocale_issue1813 is failed.
serhiy.storchaka
python-checkins at python.org
Fri Jan 10 14:35:35 CET 2014
http://hg.python.org/cpython/rev/3696b9ae6b17
changeset: 88394:3696b9ae6b17
branch: 2.7
parent: 88391:34ae4333d3bf
user: Serhiy Storchaka <storchaka at gmail.com>
date: Fri Jan 10 15:34:51 2014 +0200
summary:
Issue #20086: Output more details when test_getsetlocale_issue1813 is failed.
files:
Lib/test/test_locale.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -477,7 +477,12 @@
# Unsupported locale on this system
self.skipTest('test needs Turkish locale')
loc = locale.getlocale()
- locale.setlocale(locale.LC_CTYPE, loc)
+ try:
+ locale.setlocale(locale.LC_CTYPE, loc)
+ except Exception as e:
+ self.fail("Failed to set locale %r (default locale is %r): %r" %
+ (loc, oldlocale, e))
+ print("set locale %r (default locale is %r)" % (loc, oldlocale))
self.assertEqual(loc, locale.getlocale())
def test_normalize_issue12752(self):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list