How to navigate to the fixture definition in Visual Studio Code? #9182
-
|
Hi all, I've been searching all over the internet for an answer to this question but I haven't found anything yet. def test_not_authorized_to_publish(self, tapp, test_blogpost):
# User shouldn't be able to publish a blogpost
res = tapp.post( f"/blogposts/{test_blogpost.id}/publish")
assert "not authorised" in res.json["error"]
assert res.status_code == 401My fixtures live inside a My first thought was to manually import fixtures in my test_ files so that I can easily find where they are located. Is it a common practice? I came across this VSCode extension: https://marketplace.visualstudio.com/items?itemName=Cameron.vscode-pytest. but it doesn't seem to work for me. Anyone using it successfully? This article [Modularizing Pytest Fixtures] and this SO answer [In pytest, what is the use of conftest.py files?] were quite helpful. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
In large projects with hundreds of fixtures, how to easily navigate to the file where each fixture lives? Something link Ctrl+click to jump to the fixture definition... |
Beta Was this translation helpful? Give feedback.
-
|
Maybe a little late, but this was the first result in my Google search: |
Beta Was this translation helpful? Give feedback.
Maybe a little late, but this was the first result in my Google search:
VSCode added that feature https://code.visualstudio.com/updates/v1_76#_improved-intellisense-support-for-pytest as discussed here https://stackoverflow.com/questions/67601759/support-intellisense-for-pytest-fixtures-in-vscode