Replies: 1 comment 2 replies
-
By default, pyright doesn't emit any errors or warnings for unused import symbols, so I presume that you've enabled the So you have several options:
Alternatively (and this is the way my team handles this in our pytest-based tests), you can define your fixtures in a conftest.py file and configure pytest to consume them from this file. That way, you don't need to import them into each test module explicitly. For more details, refer to the pytest documentation. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Most of my projects use pytest, and most use pytest fixtures. Essentially, fixtures is a function that pytest will call before calling the test. But since the calling happens inside of pytest and not as part of the test code itself, pyright warns about my fixture functions not being accessed.
E.g.
pyright will complain about the
from fixtures import age
line.I do know that the pyright project doesn't want to implement third party workarounds, but is there any workarounds to avoid my editor complaining about these unused imports?
Beta Was this translation helpful? Give feedback.
All reactions