test_format fails (because of test__locale)

Irmen de Jong irmen at -nospam-remove-this-xs4all.nl
Wed Jul 14 23:30:13 CEST 2004


Tim Peters wrote:

> [Irmen de Jong]
> ,,,
> 
>>As Michael Hudson pointed out it's probably a test that
>>messes with the locale settings and forgets to set them back,
>>or some such.
> 
> 
> In case you don't already know it, regrtest.py's little-used -f
> argument lets you specify a file, containing the names of the tests
> you want to run. 

That was great, I quickly found out that test__locale is the cause.
Not only test_format but also test_unicode fail on my Mandrake 10 box.
My default locale is nl_NL. Behold:

[irmen at atlantis Python-2.4a1]$ cat testcases.in
test__locale
test_format
test_unicode

[irmen at atlantis Python-2.4a1]$ ./python Lib/test/regrtest.py -f testcases.in
test__locale
test_format
test test_format produced unexpected output:
**********************************************************************
*** line 2 of actual output doesn't appear in expected output after line 1:
+ u'%f' % (1.0,) == u'1,000000' != '1.000000'
**********************************************************************
test_unicode
test test_unicode failed -- Traceback (most recent call last):
   File "/home/irmen/BUILD/Python-2.4a1/Lib/test/test_unicode.py", line 358, in 
test_formatt             ing
     string_tests.MixinStrUnicodeUserStringTest.test_formatting(self)
   File "/home/irmen/BUILD/Python-2.4a1/Lib/test/string_tests.py", line 615, in 
test_formatt             ing
     self.checkequal('0042.00', '%07.2f', '__mod__', 42)
   File "/home/irmen/BUILD/Python-2.4a1/Lib/test/string_tests.py", line 56, in checkequal
     realresult
AssertionError: u'0042.00' != u'0042,00'

1 test OK.
2 tests failed:
     test_format test_unicode
[irmen at atlantis Python-2.4a1]$


--Irmen



More information about the Python-list mailing list