[TIP] Testing locale-dependent behaviour

Thomas Lotze thomas at thomas-lotze.de
Tue Nov 25 05:15:02 PST 2008


Michael Foord wrote:

>> You may want to read locale-gen(8), locale.gen(5), localedef(1) : it
>> looks like you can install locales in an arbitrary path. Then it becomes
>> a matter of telling setlocale(3) where to find the file you've defined.

The locale man page says the LOCPATH environment variable is responsible
for this, and it works with Python indeed. Thanks for the pointer.

>> Good luck (and please report back if you find how to do this, I'm sure
>> it will be appreciated)

I'll try to add something about locales to tl.testing.

> Our functional test suite (Windows) changes the machine locale in a couple
> of places (and changes it back again of course) to regression tests
> problems we had with specific locales (usually Unicode errors I think). I
> don't have the details to hand, but could get them if it would be useful.

I'll be sure to get back to you - thank you.

-- 
Thomas






More information about the testing-in-python mailing list