Merge pull request #972 from pimutils/pre-commit-ci-update-config

[pre-commit.ci] pre-commit autoupdate
This commit is contained in:
Hugo 2022-03-22 13:24:40 +01:00 committed by GitHub
commit 711eccedab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 30 deletions

View file

@ -14,7 +14,7 @@ repos:
- id: flake8 - id: flake8
additional_dependencies: [flake8-import-order, flake8-bugbear] additional_dependencies: [flake8-import-order, flake8-bugbear]
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: "21.12b0" rev: "22.1.0"
hooks: hooks:
- id: black - id: black
- repo: https://github.com/pycqa/isort - repo: https://github.com/pycqa/isort
@ -23,12 +23,12 @@ repos:
- id: isort - id: isort
name: isort (python) name: isort (python)
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.31.0 rev: v2.31.1
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py37-plus] args: [--py37-plus]
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.931" rev: "v0.941"
hooks: hooks:
- id: mypy - id: mypy
files: vdirsyncer/.* files: vdirsyncer/.*

View file

@ -353,16 +353,13 @@ def test_ident_conflict(tmpdir, runner):
'error: foobar: Storage "foo" contains multiple items with the ' 'error: foobar: Storage "foo" contains multiple items with the '
"same UID or even content" "same UID or even content"
) in result.output ) in result.output
assert ( assert sorted(
sorted( [
[ "one.txt" in result.output,
"one.txt" in result.output, "two.txt" in result.output,
"two.txt" in result.output, "three.txt" in result.output,
"three.txt" in result.output, ]
] ) == [False, True, True]
)
== [False, True, True]
)
@pytest.mark.parametrize( @pytest.mark.parametrize(

View file

@ -155,18 +155,15 @@ async def test_expand_collections(shortcuts, expected):
async def handle_not_found(config, collection): async def handle_not_found(config, collection):
return missing return missing
assert ( assert sorted(
sorted( await aiostream.stream.list(
await aiostream.stream.list( expand_collections(
expand_collections( shortcuts,
shortcuts, config_a,
config_a, config_b,
config_b, get_discovered_a,
get_discovered_a, get_discovered_b,
get_discovered_b, handle_not_found,
handle_not_found,
)
) )
) )
== sorted(expected) ) == sorted(expected)
)

View file

@ -126,10 +126,10 @@ def sync(ctx, collections, force_delete):
from .tasks import prepare_pair from .tasks import prepare_pair
from .tasks import sync_collection from .tasks import sync_collection
async def main(collections): async def main(collection_names):
async with aiohttp.TCPConnector(limit_per_host=16) as conn: async with aiohttp.TCPConnector(limit_per_host=16) as conn:
tasks = [] tasks = []
for pair_name, collections in collections: for pair_name, collections in collection_names:
async for collection, config in prepare_pair( async for collection, config in prepare_pair(
pair_name=pair_name, pair_name=pair_name,
collections=collections, collections=collections,
@ -163,10 +163,10 @@ def metasync(ctx, collections):
from .tasks import metasync_collection from .tasks import metasync_collection
from .tasks import prepare_pair from .tasks import prepare_pair
async def main(collections): async def main(collection_names):
async with aiohttp.TCPConnector(limit_per_host=16) as conn: async with aiohttp.TCPConnector(limit_per_host=16) as conn:
for pair_name, collections in collections: for pair_name, collections in collection_names:
collections = prepare_pair( collections = prepare_pair(
pair_name=pair_name, pair_name=pair_name,
collections=collections, collections=collections,