[IPython-dev] Unicode in tests

Thomas Kluyver takowl at gmail.com
Tue Feb 1 16:36:42 EST 2011


(Apologies, I have a bad habit of hitting reply instead of reply-all, so the
last two messages didn't go to the list)

If GTK is changing the default encoding, presumably there isn't an easy fix
from our point of view? So somehow, we need to compartmentalise the tests
which use GTK from the tests which use non-ASCII characters. Is my current
strategy (main test suite and unicode tests) sensible, or would it make more
sense to include unicode in the main test suite, and have any tests which
imported gtk separate? I think the latter could be hard to enforce as new
tests are added.

Or am I missing some way that the tests can be combined properly?

Thomas

On 1 February 2011 20:20, Robert Kern <robert.kern at gmail.com> wrote:

> GTK is the culprit.
>
> Robert Kern
> On Feb 1, 2011 11:54 AM, "Thomas Kluyver" <takowl at gmail.com> wrote:
> > It has what I assume to be the standard plugins shipped with nose. The
> > following are listed in sys.modules:
> >
> > allmodules, attrib, base, builtin, capture, collect, cover, cPickle,
> > cStringIO, debug, deprecated, doctest, doctests, errorclass,
> failuredetail,
> > hotshot, inspect, isolate, logcapture, logging, manager, multiprocess,
> nose,
> > optparse, os, pdb, pickle, pkg_resources, plugintest, prof, Queue, re,
> skip,
> > StringIO, sys, tempfile, testid, textwrap, threading, time, traceback,
> > unittest, warnings, xml, xunit
> >
> > They are all either showing a path within the virtualenv, or the module
> > itself is None.
> >
> > However, the various imports in the test suite have brought in over 1000
> > modules. Could something like Zope or GTK be the offending party (just
> > scanning down the list)?
> >
> > Thomas
> >
> > On 1 February 2011 19:28, Robert Kern <robert.kern at gmail.com> wrote:
> >
> >> On 2/1/11 4:02 AM, Thomas Kluyver wrote:
> >> > While testing the use of non-ascii characters in 0.11 recently, I
> found
> >> that
> >> > there are things which will fail while actually using ipython, but
> cannot
> >> be
> >> > made to fail in the test suite. Investigating, I found that for the
> test
> >> suite,
> >> > the default encoding is somehow set to utf-8 (ascii is the default
> >> default
> >> > encoding for Python 2). I don't know quite what's doing this, but it
> did
> >> the
> >> > same with my system version of nose (0.11.1 in Ubuntu) and with nose
> >> 1.0.0
> >> > installed in the virtualenv.
> >> >
> >> > At present, I've worked round that by adding an entirely separate
> >> > unicode_tests.py file, which has to be run separately from the main
> >> iptest test
> >> > suite.
> >> >
> >> > https://github.com/ipython/ipython/pull/252
> >> >
> >> > Does anyone have any insight on whether this is something our test
> suite
> >> is
> >> > doing, something nose is doing, something that can be fixed, or
> something
> >> that
> >> > we have to work around?
> >>
> >> There is no code in IPython or nose itself that does this. Can you make
> >> sure
> >> that nose is not picking up any extra plugins (print out sys.modules
> inside
> >> of a
> >> test suite)?
> >>
> >> --
> >> Robert Kern
> >>
> >> "I have come to believe that the whole world is an enigma, a harmless
> >> enigma
> >> that is made terrible by our own mad attempt to interpret it as though
> it
> >> had
> >> an underlying truth."
> >> -- Umberto Eco
> >>
> >> _______________________________________________
> >> IPython-dev mailing list
> >> IPython-dev at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/ipython-dev
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20110201/57986d31/attachment.html>


More information about the IPython-dev mailing list