Skip to content

Commit

Permalink
Merge pull request #2198 from pre-commit/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
asottile committed Jan 10, 2022
2 parents 445a2ef + bba6cf4 commit b944395
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -44,7 +44,7 @@ repos:
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.930
rev: v0.931
hooks:
- id: mypy
additional_dependencies: [types-all]
Expand Down
3 changes: 1 addition & 2 deletions pre_commit/xargs.py
Expand Up @@ -159,8 +159,7 @@ def run_cmd_partition(
)

threads = min(len(partitions), target_concurrency)
# https://github.com/python/mypy/issues/11852
with _thread_mapper(threads) as thread_map: # type: ignore
with _thread_mapper(threads) as thread_map:
results = thread_map(run_cmd_partition, partitions)

for proc_retcode, proc_out, _ in results:
Expand Down
6 changes: 2 additions & 4 deletions tests/xargs_test.py
Expand Up @@ -166,15 +166,13 @@ def test_xargs_concurrency():


def test_thread_mapper_concurrency_uses_threadpoolexecutor_map():
# https://github.com/python/mypy/issues/11852
with xargs._thread_mapper(10) as thread_map: # type: ignore
with xargs._thread_mapper(10) as thread_map:
_self = thread_map.__self__ # type: ignore
assert isinstance(_self, concurrent.futures.ThreadPoolExecutor)


def test_thread_mapper_concurrency_uses_regular_map():
# https://github.com/python/mypy/issues/11852
with xargs._thread_mapper(1) as thread_map: # type: ignore
with xargs._thread_mapper(1) as thread_map:
assert thread_map is map


Expand Down

0 comments on commit b944395

Please sign in to comment.