Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@
// Increase the number of PR's Renovate can create in a hour. Default is 2.
"prHourlyLimit": 5,

// Temporarily disabled:
"ignoreDeps": ["pytest-asyncio"],

// schedule to allow PR's from Renovate:
"schedule": ["* * * * 0"] // Every Sunday

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ tests = [
# For the test suite
"pytest==9.1.1",
# needed because pytest doesn't come with native support for coroutines as tests
"pytest-asyncio==0.21.2",
"pytest-asyncio==1.4.0",
# xdist runs tests in parallel
"pytest-xdist==3.8.0",
# no_req tests must be fully offline, including during higher-scoped fixture setup
Expand Down Expand Up @@ -231,6 +231,8 @@ markers = [
"req",
]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
asyncio_default_test_loop_scope = "session"
log_cli_format = "%(funcName)s - Line %(lineno)d - %(message)s"
# log_cli_level = "DEBUG" # uncomment to see DEBUG logs

Expand Down
15 changes: 0 additions & 15 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
#
# You should have received a copy of the GNU Lesser Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
import asyncio
import os
import sys
import zoneinfo
from pathlib import Path
from uuid import uuid4
Expand Down Expand Up @@ -105,19 +103,6 @@ def PTB_TIMEDELTA(request):
monkeypatch.undo()


# Redefine the event_loop fixture to have a session scope. Otherwise `bot` fixture can't be
# session. See https://github.com/pytest-dev/pytest-asyncio/issues/68 for more details.
@pytest.fixture(scope="session")
def event_loop(request):
# ever since ProactorEventLoop became the default in Win 3.8+, the app crashes after the loop
# is closed. Hence, we use SelectorEventLoop on Windows to avoid this. See
# https://github.com/python/cpython/issues/83413, https://github.com/encode/httpx/issues/914
if sys.platform.startswith("win"):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
return asyncio.get_event_loop_policy().new_event_loop()
# loop.close() # instead of closing here, do that at the every end of the test session


@pytest.fixture(scope="session")
def bot_info() -> dict[str, str]:
return BOT_INFO_PROVIDER.get_info()
Expand Down
21 changes: 16 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading