Debian Codegraph @

tests/isolated/env_tpool_zero.py

raw
1 __test__ = False
2
3 if __name__ == '__main__':
4 import warnings
5 from eventlet import tpool
6 g = [False]
7
8 def do():
9 g[0] = True
10
11 with warnings.catch_warnings(record=True) as ws:
12 warnings.simplefilter('always', category=RuntimeWarning)
13
14 tpool.execute(do)
15
16 msgs = [str(w) for w in ws]
17 assert len(ws) == 1, msgs
18 msg = str(ws[0].message)
19 assert 'Zero threads in tpool' in msg
20 assert 'EVENTLET_THREADPOOL_SIZE' in msg
21
22 assert g[0]
23 print('pass')