Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 31, 2021
1 parent 5026622 commit 17c0c94
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/unit/seed/wheels/test_periodic_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def test_download_periodic_stop_at_first_usable(tmp_path, mocker, freezer):
wheel = get_embed_wheel("pip", "3.9")
app_data_outer = AppDataDiskFolder(str(tmp_path / "app"))
pip_version_remote = [wheel_path(wheel, (0, 1, 1)), wheel_path(wheel, (0, 1, 0))]
rel_date_remote = [_UP_NOW - timedelta(days=1), _UP_NOW - timedelta(days=30)]
rel_date_remote = [_UP_NOW - timedelta(days=1), _UP_NOW - timedelta(days=30)]
at = {"download": 0, "release_date": 0}

def download():
Expand All @@ -565,7 +565,9 @@ def download():
yield Wheel(Path(path))

download_gen = download()
download_wheel = mocker.patch("virtualenv.seed.wheels.acquire.download_wheel", side_effect=lambda *a, **k: next(download_gen))
download_wheel = mocker.patch(
"virtualenv.seed.wheels.acquire.download_wheel", side_effect=lambda *a, **k: next(download_gen)
)

def rel_date():
while True:
Expand All @@ -574,7 +576,10 @@ def rel_date():
yield value

rel_date_gen = rel_date()
release_date = mocker.patch("virtualenv.seed.wheels.periodic_update.release_date_for_wheel_path", side_effect=lambda *a, **k: next(rel_date_gen))
release_date = mocker.patch(
"virtualenv.seed.wheels.periodic_update.release_date_for_wheel_path",
side_effect=lambda *a, **k: next(rel_date_gen),
)

last_update = _UP_NOW - timedelta(days=14)
u_log = UpdateLog(started=last_update, completed=last_update, versions=[], periodic=True)
Expand Down Expand Up @@ -605,7 +610,9 @@ def download():
yield Wheel(Path(path))

download_gen = download()
download_wheel = mocker.patch("virtualenv.seed.wheels.acquire.download_wheel", side_effect=lambda *a, **k: next(download_gen))
download_wheel = mocker.patch(
"virtualenv.seed.wheels.acquire.download_wheel", side_effect=lambda *a, **k: next(download_gen)
)

def rel_date():
while True:
Expand All @@ -614,7 +621,10 @@ def rel_date():
yield value

rel_date_gen = rel_date()
release_date = mocker.patch("virtualenv.seed.wheels.periodic_update.release_date_for_wheel_path", side_effect=lambda *a, **k: next(rel_date_gen))
release_date = mocker.patch(
"virtualenv.seed.wheels.periodic_update.release_date_for_wheel_path",
side_effect=lambda *a, **k: next(rel_date_gen),
)

last_update = _UP_NOW - timedelta(days=14)
u_log = UpdateLog(started=last_update, completed=last_update, versions=[], periodic=True)
Expand Down

0 comments on commit 17c0c94

Please sign in to comment.