python version-specific codepaths in tests

Gordon Tyler gordon at doxxx.net
Fri Nov 20 01:37:08 GMT 2009


John Arbash Meinel wrote:
> I would make sure it works first. If SIGTERM is built on
> TerminateProcess, I think it works, but I'd want to make sure it doesn't
> kill the testing process.

I've been using it this evening while adding a test for bzr serve. All
the bzr serve tests seem to work fine on win32. Haven't tested it on
non-win32 yet.

There is a wee snag though: the tests which make use of
finish_bzr_subprocess' signalling capability use SIGINT, to simulate a
user pressing Ctrl-C I'm guessing. The Win32 implementation of
Popen.send_signal only allows SIGTERM. I could make it translate SIGINT
to SIGTERM but that changes bzr's output (no 'bzr: interrupted'). I'm
wondering if it's important enough to simulate user interruption in
those cases or if it's acceptable to use SIGTERM in those tests instead.

The code which uses SIGINT:

TestActuallyStartBzrSubprocess
- test_start_and_stop_bzr_subprocess_send_signal

TestBzrServe
- assertServerFinishesCleanly (which is used by most of the actual tests
in TestBzrServe)

Ciao,
Gordon



More information about the bazaar mailing list