Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: Lib/test/test_locale.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_kqueue.py ('k') | Lib/test/test_logging.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 from test.support import run_unittest, verbose 1 from test.support import run_unittest, verbose
2 import unittest 2 import unittest
3 import locale 3 import locale
4 import sys 4 import sys
5 import codecs 5 import codecs
6 6
7 enUS_locale = None 7 enUS_locale = None
8 8
9 def get_enUS_locale(): 9 def get_enUS_locale():
10 global enUS_locale 10 global enUS_locale
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 def test_setlocale_category(self): 383 def test_setlocale_category(self):
384 locale.setlocale(locale.LC_ALL) 384 locale.setlocale(locale.LC_ALL)
385 locale.setlocale(locale.LC_TIME) 385 locale.setlocale(locale.LC_TIME)
386 locale.setlocale(locale.LC_CTYPE) 386 locale.setlocale(locale.LC_CTYPE)
387 locale.setlocale(locale.LC_COLLATE) 387 locale.setlocale(locale.LC_COLLATE)
388 locale.setlocale(locale.LC_MONETARY) 388 locale.setlocale(locale.LC_MONETARY)
389 locale.setlocale(locale.LC_NUMERIC) 389 locale.setlocale(locale.LC_NUMERIC)
390 390
391 # crasher from bug #7419 391 # crasher from bug #7419
392 self.assertRaises(locale.Error, locale.setlocale, 12345) 392 self.assertRaises(locale.Error, locale.setlocale, 12345)
393
394 def test_getsetlocale_issue1813(self):
395 # Issue #1813: setting and getting the locale under a Turkish locale
396 oldlocale = locale.getlocale()
397 self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
398 try:
399 locale.setlocale(locale.LC_CTYPE, 'tr_TR')
400 except locale.Error:
401 # Unsupported locale on this system
402 self.skipTest('test needs Turkish locale')
403 loc = locale.getlocale()
404 locale.setlocale(locale.LC_CTYPE, loc)
405 self.assertEqual(loc, locale.getlocale())
406 393
407 394
408 def test_main(): 395 def test_main():
409 tests = [ 396 tests = [
410 TestMiscellaneous, 397 TestMiscellaneous,
411 TestFormatPatternArg, 398 TestFormatPatternArg,
412 TestLocaleFormatString, 399 TestLocaleFormatString,
413 TestEnUSNumberFormatting, 400 TestEnUSNumberFormatting,
414 TestCNumberFormatting, 401 TestCNumberFormatting,
415 TestFrFRNumberFormatting, 402 TestFrFRNumberFormatting,
416 TestCollation 403 TestCollation
417 ] 404 ]
418 # SkipTest can't be raised inside unittests, handle it manually instead 405 # SkipTest can't be raised inside unittests, handle it manually instead
419 try: 406 try:
420 get_enUS_locale() 407 get_enUS_locale()
421 except unittest.SkipTest as e: 408 except unittest.SkipTest as e:
422 if verbose: 409 if verbose:
423 print("Some tests will be disabled: %s" % e) 410 print("Some tests will be disabled: %s" % e)
424 else: 411 else:
425 tests += [TestNumberFormatting, TestEnUSCollation] 412 tests += [TestNumberFormatting, TestEnUSCollation]
426 run_unittest(*tests) 413 run_unittest(*tests)
427 414
428 if __name__ == '__main__': 415 if __name__ == '__main__':
429 test_main() 416 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_kqueue.py ('k') | Lib/test/test_logging.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+