[Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py,1.1,1.2

Guido van Rossum guido@python.org
Sat, 27 Jul 2002 17:51:50 -0400


> A better fix, IMO, is to recognize that the `test' package has become
> a full fledged standard lib package (a Good Thing, IMO), heed our own
> admonitions not to do relative imports, and change the various places
> in the test suite that "import test_support" (or equiv) to "import
> test.test_support" (or equiv).

Good idea.

> I've twiddled the test suite to do things this way, and all the
> (expected Linux) tests pass, so I'd like to commit these changes.

You've done this by now, right?  Fine.

> Unit test writers need to remember to use test.test_support instead of
> just test_support.  We could do something wacky like remove '' from
> sys.path if we really cared about enforcing this.  It would also be
> good for folks on other systems to make sure I haven't missed a
> module.

Perhaps it would be a good idea for test_support (and perhaps some
other crucial testing support modules) to add something at the top
like this?

   if __name__ != "test.test_support":
      raise ImportError, "test_support must be imported from the test package"

--Guido van Rossum (home page: http://www.python.org/~guido/)