On 08/28/12 04:20 PM, Tim Foster wrote:
On 08/29/12 11:00 AM, Erik Trauschke wrote:
This is a quick fix for 7194691 which might save people, who don't know
about the unwritten rule of running the test suite under locale C, some
time.

I wonder could we also raise TestSkippedExceptions for any tests that
are known fail in non-C locales (I forget what these are off the top of
my head, but there's 2 or 3)

For me, in the UTF-8 locale, these tests fail:
cli.t_pkg_temp_sources.py TestPkgTempSources.test_01_info
cli.t_pkg_composite.py TestPkgCompositePublishers.test_01_info
cli.t_pkg_info.py TestPkgInfoBasics.test_ranked
cli.t_pkg_info.py TestPkgInfoBasics.test_renamed_packages
cli.t_pkgrecv.py TestPkgrecvMulti.test_2_recv_compare

And this test still fails but I think it doesn't have anything to do with my set locale.

cli.t_pkg_help.py TestPkgHelp.test_help_character_encoding

I was going to suggest a wrapper[1] to force the test to run in C, but
it's actually useful to test in non-C locales too I think.

We discussed the use of a wrapper, it's another viable option. Shawn mentioned there might be some issues with setting the locale after Python has been started (due to some internal locale mangling in Python), however, when using Popen that shouldn't be an issue.

It seems to be common practice to use C locale for building workspaces and running the test suite and this problem has popped up before but nobody thought it was worth changing something. I just wanted to come up with something which prevents somebody who doesn't know about it from searching around for an hour to see what's wrong.

Erik


cheers,
tim

[1] along the lines of

#!/usr/bin/python
import os
import subprocess
import sys

if __name__ == "__main__":
if os.environ.get("LANG", "C") != "C":
print "restarting in C locale!"
os.environ["LANG"] = "C"
p = subprocess.Popen(sys.argv)
sys.stdout, sys.stderr = p.communicate()
else:
print "already running in C locale"
# continue with the rest of the suite
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to