I am using PyUnit Test framework for test case automation.

I am generating graphs using matplotlib inside a thread.

If I execute more than one test cases the call to

plt.figure which intern calls to _tkinter.create seems to hang.

If I execute single test case everything works fine.

I have closed the Pylab by pylab.close and also cleared the memory for figure using fig.clf.

Could you please help me in understanding what is going wrong here.

Appreciate your time and efforts.