[Python-Dev] regression test question (original) (raw)

Thomas Wouters thomas@xs4all.net
Tue, 22 Aug 2000 00:13:32 +0200


On Mon, Aug 21, 2000 at 04:32:22PM -0400, Fred L. Drake, Jr. wrote:

I'm working on bringing the parser module up to date and introducing a regression test for it. (And if the grammar stops changing, it may actually get finished!)

Well, I have augmented assignment in the queue, but that's about it for Grammar changing patches ;)

I'm having a bit of a problem, though: the test passes when run as a script, but not when run via the regression test framework. The problem is not with the output file. I'm getting an exception from the module which is not expected, and is only raised when it runs using the regression framework. Has anyone else encountered a similar problem? I've checked to make sure the right version or parsermodule.so and testparser.py are being picked up.

I've seen this kind of problem when writing the pty test suite: fork() can do nasty things to the regression test suite. You have to make sure the child process exits brutally, in all cases, and does not output anything, etc. I'm not sure if that's your problem though. Another issue I've had to deal with was with a signal/threads problem on BSDI: enabling threads screwed up random tests after the signal or thread test (never could figure out what triggered it ;)

(This kind of problem is generic: several test modules, like test_signal, set 'global' attributes to test something, and don't always reset them. If you type ^C at the right moment in the test process, test_signal doesn't remove the SIGINT-handler, and subsequent ^C's dont do anything other than saying 'HandlerBC called' and failing the test ;))

I'm guessing this is what your parser test is hitting: the regression tester itself sets something differently from running it directly. Try importing the test from a script rather than calling it directly ? Did you remember to set PYTHONPATH and such, like 'make test' does ? Did you use '-tt' like 'make test' does ?

-- Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!