我使用 pytest-parallel 插件(https://github.com/browsertron/pytest-parallel)并希望动态设置线程名称,例如:
pytest_parallel/__init__.py
.....
import time
class ThreadWorker(threading.Thread):
def __init__(self, queue, session, errors):
_name = "Thread_" + str(time.time())
threading.Thread.__init__(self, name=_name)
self.queue = queue
self.session = session
self.errors = errors
.....
但它总是卡在 Ubuntu 上。设置线程名称的正确方法是什么?你能帮忙吗?