nose-devs / nose

nose is nicer testing for python
http://readthedocs.org/docs/nose/en/latest/
1.36k stars 395 forks source link

nosetests hangs with Queue + threading #1048

Open sunqm opened 7 years ago

sunqm commented 7 years ago

A test code using Queue, threading with numpy hangs nosetests. The code looks like:

import numpy
from Queue import Queue
from threading import Thread

a = numpy.eye(100)
q = Queue()
def g(x):
    return a.dot(a) * x
def f(x):
    q.put(g(x))

t = Thread(target=f, args=(1,))
t.start()
t.join()
b = q.get()