Massive unit test vs MySQL

Neil Padgen neil.padgen at mon.bbc.co.uk
Fri Sep 5 11:04:30 EDT 2003


On Thursday 04 September 2003 20:35, Richard Wesley wrote:

> I have a unit test suite for our server that loads a clean database
> image for many of the tests.  I use
> 
> p = os.popen('mysql -u uid -ppassword mydatabase', 'w')
> p.write(sql_commands)

Your pipe is still open at this point, and therefore you have a
connection to the database open.

> So my question would be, is there any way to shut down the child
> process so that MySQL notices and cleans up after itself before it
> runs out of threads?

p.close()

-- Neil




More information about the Python-list mailing list