File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 2626 - name : Install dependencies
2727 run : |
2828 python -m pip install --upgrade pip
29- python -m pip install flake8 pytest
29+ python -m pip install flake8 pytest pytest-asyncio
3030 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3131 - name : Lint with flake8
3232 run : |
Original file line number Diff line number Diff line change @@ -165,13 +165,25 @@ def run(self):
165165 _base .LOGGER .critical ('Exception in worker' , exc_info = True )
166166
167167
168+
168169class _CustomWeakSet (weakref .WeakSet ):
169170
170171 def __repr__ (self ):
171172 return repr (self .data )
172173
173174
174- class BrokenThreadPool (_base .BrokenExecutor ):
175+ class BrokenExecutor (RuntimeError ):
176+ """
177+ Raised when a executor has become non-functional after a severe failure.
178+ """
179+
180+ # Upward Compatible
181+ _class_brokenexecutor = BrokenExecutor
182+ if 'BrokenExecutor' in dir (_base ):
183+ _class_brokenexecutor = _base .BrokenExecutor
184+
185+
186+ class BrokenThreadPool (_class_brokenexecutor ):
175187 """
176188 Raised when a worker thread in a ThreadPoolExecutor failed initializing.
177189 """
@@ -308,4 +320,4 @@ def shutdown(self, wait=True):
308320 if wait :
309321 for t in self ._threads :
310322 t .join ()
311- shutdown .__doc__ = _base .Executor .shutdown .__doc__
323+ shutdown .__doc__ = _base .Executor .shutdown .__doc__
Original file line number Diff line number Diff line change 11import os , sys
2- o_path = os .getcwd ()
3- sys .path .append (os .path .split (o_path )[0 ])
2+ sys .path .append (os .getcwd ())
43import pytest
54from ThreadPoolExecutorPlus import *
65
6+ @pytest .mark .asyncio
77async def test_import ():
8+ ThreadPoolExecutor ()
89 ...
You can’t perform that action at this time.
0 commit comments