mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-05-06 23:39:13 -05:00
work around python/mypy#11852
This commit is contained in:
+2
-1
@@ -159,7 +159,8 @@ def xargs(
|
||||
)
|
||||
|
||||
threads = min(len(partitions), target_concurrency)
|
||||
with _thread_mapper(threads) as thread_map:
|
||||
# https://github.com/python/mypy/issues/11852
|
||||
with _thread_mapper(threads) as thread_map: # type: ignore
|
||||
results = thread_map(run_cmd_partition, partitions)
|
||||
|
||||
for proc_retcode, proc_out, _ in results:
|
||||
|
||||
+4
-2
@@ -166,13 +166,15 @@ def test_xargs_concurrency():
|
||||
|
||||
|
||||
def test_thread_mapper_concurrency_uses_threadpoolexecutor_map():
|
||||
with xargs._thread_mapper(10) as thread_map:
|
||||
# https://github.com/python/mypy/issues/11852
|
||||
with xargs._thread_mapper(10) as thread_map: # type: ignore
|
||||
_self = thread_map.__self__ # type: ignore
|
||||
assert isinstance(_self, concurrent.futures.ThreadPoolExecutor)
|
||||
|
||||
|
||||
def test_thread_mapper_concurrency_uses_regular_map():
|
||||
with xargs._thread_mapper(1) as thread_map:
|
||||
# https://github.com/python/mypy/issues/11852
|
||||
with xargs._thread_mapper(1) as thread_map: # type: ignore
|
||||
assert thread_map is map
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user