[Python-Dev] test_socketserver fails

Guido van Rossum guido@python.org
Mon, 17 Sep 2001 14:24:45 -0400


>   GvR> python Lib/test/test_socketserver.py
> 
> Aha!  Then the code at the top is really broken:
> 
> # XXX This must be run manually -- somehow the I/O redirection of the
> # regression test breaks the test.
> 
> from test_support import verbose, verify, TESTFN, TestSkipped
> if not verbose:
>     raise TestSkipped, "test_socketserver can only be run manually"

I guess when I say "run a test manually" I think "from the command
line", not "from the interactive prompt". :-(

> There are two substantial problems.  First, the comment about I/O
> redirection is wrong.

I remember I couldn't figure out *why* it was failing. :-(

> Second, if you do run regrtest.py -v, then the
> test will be run anyway.  This is how I first stumbled over the
> problem.  Another test was failing and I used -v to figure out why.
> But regrtest.py also reported that test_socketserver failed and then
> hung, because socketserver non-daemon threads were still running.

Yup, that's a problem.

> So what's the right way to fix this test?  If the test can't be run as
> part of regrtest and can't be imported, I wonder why it's in Lib/test
> to begin with.

pystone.py is also in Lib/test.  It's a collection of tests.  Maybe
this test should be renamed.

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