Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lsp: Update to pytest-asyncio v0.23 #707

Merged
merged 2 commits into from
Jan 1, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ updates:
target-branch: "develop"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/lib/esbonio/tests/workspaces/demo"
target-branch: "develop"
Expand Down
16 changes: 0 additions & 16 deletions lib/esbonio/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import pathlib

import pytest
Expand All @@ -19,18 +18,3 @@ def fn(*args):
return Uri.for_file(str(path))

return fn


@pytest.fixture(scope="session")
def event_loop():
# We need to redefine the event_loop fixture to match the scope of our
# client_server fixture.
#
# https://github.com/pytest-dev/pytest-asyncio/issues/68#issuecomment-334083751

loop = asyncio.get_event_loop_policy().new_event_loop()
asyncio.set_event_loop(loop)

yield loop

loop.close()
4 changes: 2 additions & 2 deletions lib/esbonio/tests/e2e/test_e2e_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def document_symbol(
),
],
)
@pytest.mark.asyncio
@pytest.mark.asyncio(scope="session")
async def test_document_symbols(
client: LanguageClient,
uri_for,
Expand Down Expand Up @@ -249,7 +249,7 @@ async def test_document_symbols(
("--not-a-real-symbol-name--", None),
],
)
@pytest.mark.asyncio
@pytest.mark.asyncio(scope="session")
async def test_workspace_symbols(
client: LanguageClient,
query: str,
Expand Down
2 changes: 1 addition & 1 deletion lib/esbonio/tests/sphinx-agent/test_sa_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def client_build_error(
yield


@pytest.mark.asyncio
@pytest.mark.asyncio(scope="module")
async def test_build_error(client_build_error: SubprocessSphinxClient):
"""Ensure that when a build error occurs, useful information is reported."""

Expand Down
2 changes: 1 addition & 1 deletion lib/esbonio/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ deps =
coverage[toml]
pytest
pytest-lsp>=0.3.1
pytest-asyncio!=0.23.0,!=0.23.1,!=0.23.2
pytest-asyncio>=0.23.3
set_env = COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
commands_pre =
python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")'
Expand Down