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

pytest-asyncio v0.23 support #126

Closed
alcarney opened this issue Jan 1, 2024 · 0 comments · Fixed by #146
Closed

pytest-asyncio v0.23 support #126

alcarney opened this issue Jan 1, 2024 · 0 comments · Fixed by #146
Labels
bug Something isn't working enhancement New feature or request pytest-lsp Issues affecting the pytest-lsp package

Comments

@alcarney
Copy link
Member

alcarney commented Jan 1, 2024

This release includes some breaking changes that at the very least will require an update to the documentation.

Something else to investigate is that esbonio's test suite will hang (on my machine at least ...) if a test requests a fixture with a scope and that scope is not also explicitly requested in the test's mark

@pytest_lsp.fixture(
    scope="session",
    config=ClientServerConfig(
        server_command=[sys.executable, *SERVER_CMD],
    ),
)
async def client(lsp_client: LanguageClient, uri_for, tmp_path_factory):
    ...

@pytest.mark.asyncio(scope="session")  # <-- hangs if not set!
async def test_workspace_symbols(client: LanguageClient, ...):
    ...

Interestingly however, the following tests appear to run fine without issue

@pytest_asyncio.fixture(scope="session")
async def slow_start():
    await asyncio.sleep(1)
    yield True

@pytest.mark.asyncio
async def test_one(slow_start):
    await asyncio.sleep(1)
    assert slow_start is True

@pytest.mark.asyncio
async def test_two(slow_start):
    await asyncio.sleep(1)
    assert slow_start is False

Which suggests perhaps pytest-lsp is doing something that doesn't quite agree with pytest-asyncio's new setup.

@alcarney alcarney added bug Something isn't working enhancement New feature or request pytest-lsp Issues affecting the pytest-lsp package labels Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request pytest-lsp Issues affecting the pytest-lsp package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant