Skip to content

Commit

Permalink
Bump pytest-asyncio from 0.21.1 to 0.23.4 (#1625)
Browse files Browse the repository at this point in the history
* Bump pytest-asyncio from 0.21.1 to 0.23.2

Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.21.1 to 0.23.2.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.21.1...v0.23.2)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Set the mocked Master loop to current loop and supply a ThreadPool

* Newer pytest-asyncio

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cooper Lees <[email protected]>
  • Loading branch information
dependabot[bot] and cooperlees authored Jan 30, 2024
1 parent 51478f0 commit bcf4568
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ freezegun==1.3.1
mypy==1.8.0
pre-commit==3.6.0
pytest==7.4.4
pytest-asyncio==0.21.1
pytest-asyncio==0.23.4
pytest-timeout==2.2.0
setuptools==69.0.3
tox==4.12.1
Expand Down
6 changes: 5 additions & 1 deletion src/bandersnatch/tests/test_master.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import asyncio
import concurrent.futures
from pathlib import Path
from tempfile import gettempdir
from unittest.mock import AsyncMock, patch
Expand Down Expand Up @@ -72,7 +74,9 @@ async def test_master_doesnt_raise_if_serial_equal(master: Master) -> None:
@pytest.mark.asyncio
async def test_master_url_fetch(master: Master) -> None:
fetch_path = Path(gettempdir()) / "unittest_url_fetch"
await master.url_fetch("https://unittest.org/asdf", fetch_path)
master.loop = asyncio.get_running_loop()
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as thread_pool:
await master.url_fetch("https://unittest.org/asdf", fetch_path, thread_pool)
assert master.session.get.called


Expand Down

0 comments on commit bcf4568

Please sign in to comment.