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

External pytest fixtures not autocompleted #319

Open
stinovlas opened this issue Jun 21, 2024 · 0 comments
Open

External pytest fixtures not autocompleted #319

stinovlas opened this issue Jun 21, 2024 · 0 comments

Comments

@stinovlas
Copy link

pytest                8.2.2
jedi                  0.19.1
jedi-language-server  0.41.4

Jedi recognizes fixtures from pytest itself and also my own fixtures defined in the same module or conftest.py. However, external pytest fixtures (such as mocker from pytest-mock or faker from Faker are not autocompleted. I first thought this is an issue with jedi itself, but apparently, it's not:

import jedi

source = """
def test_fixture(faker):
    faker.
"""

script = jedi.Script(source, path="example.py")
completions = script.complete(3, len("    faker."))
print(completions)

This does return expected autocompletions.

However, when I write the same test code in neovim with jedi-language-server attached to neovim LSP, this fixture is not autocompleted. I use default jedi-language-server settings.

I'd be happy to provide more details, if that helps with resolving the problem, but I don't know how to call jedi-language-server's API directly, so I'd need some pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant