Rev 5629: (jelmer) Fix test_locale test on systems where the default locale is not C. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Jan 21 22:45:48 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5629 [merge]
revision-id: pqm at pqm.ubuntu.com-20110121224545-j7ie4ubrplzw0tvv
parent: pqm at pqm.ubuntu.com-20110121172225-7mybq84k4ikcails
parent: jelmer at samba.org-20110121181941-g2kds4pclkjrr7lx
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-01-21 22:45:45 +0000
message:
  (jelmer) Fix test_locale test on systems where the default locale is not C.
   (Jelmer Vernooij)
modified:
  bzrlib/tests/blackbox/test_locale.py test_lang.py-20060824204205-80v50j25qkuop7yn-1
=== modified file 'bzrlib/tests/blackbox/test_locale.py'
--- a/bzrlib/tests/blackbox/test_locale.py	2009-09-18 08:50:05 +0000
+++ b/bzrlib/tests/blackbox/test_locale.py	2011-01-21 18:19:41 +0000
@@ -16,7 +16,6 @@
 
 """Test that bzr handles locales in a reasonable way"""
 
-import os
 import sys
 
 from bzrlib import (
@@ -44,10 +43,13 @@
 
     def test_log_C(self):
         self.disable_missing_extensions_warning()
+        # C is not necessarily the default locale, so set both LANG and LC_ALL
+        # explicitly because LC_ALL is preferred on (some?) Linux systems but
+        # only LANG is respected on Windows.
         out, err = self.run_bzr_subprocess(
             '--no-aliases --no-plugins log -q --log-format=long tree',
-               env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none',
-                            'LC_ALL':None, 'LC_CTYPE':None, 'LANGUAGE':None})
+               env_changes={'LANG': 'C', 'BZR_PROGRESS_BAR':'none',
+                            'LC_ALL': 'C', 'LC_CTYPE':None, 'LANGUAGE':None})
         self.assertEqual('', err)
         self.assertEqualDiff("""\
 ------------------------------------------------------------




More information about the bazaar-commits mailing list