Open zmievsa opened 11 months ago
@zmievsa
Try adding a type hint with that class name to both functions. You will see that it gives autocompletion for one but doesn't for another. It should give autocompletion for both.
I am not sure what you meant? where are you adding the type hint? after s
? like s: <= here?
and by that class name you meant MyVeryLongClassName
?
Yes! Exactly! :)
@zmievsa I assume the s
is another fixture? and you want to write fixture's type explicitly?
the bug here is when user is trying to write fixture's type directly, we don't show completion for that. we let them auto insert it using code action
or inlay hint
but doesn't help writing it manually.
Yes. This is very much the bug I'm encountering.
I understand very well that It was intentional for you not to support this behavior because you can auto-generate annotations.
However, "pytest-fixture-classes" is not supported by pylance and hence it doesn't auto-generate annotations too which gives me essentially no way to work with that package conveniently (my package so I'm biased but bear with me).
Essentially there is no way to define factory fixtures with pytest and without any repetition, which is why we use "pytest-fixture-classes". I am quite ok with this package not being supported by pylance — it's not super popular. But let's at least consider supporting auto-completion for annotations of fixtures in tests and other fixtures. It shouldn't be too hard to do and I would love to do it myself if there is any developer documentation in pylance :)
what do you mean by pytest-fixture-classes
can you give us a link? so we can see whether we can add a suport for it?
Here it is: https://github.com/zmievsa/pytest-fixture-classes
Sorry for not providing it with the initial message :)
@heejaechang what do you think?
Environment data
Code Snippet
Repro Steps
Try adding a type hint with that class name to both functions. You will see that it gives autocompletion for one but doesn't for another. It should give autocompletion for both.
Logs
Attached. [Uploading logs.txt…]()