Environment data
- Pylance version: v2024.8.101 (pre-release)
- ProductName: macOS
- ProductVersion: 14.2.1
- BuildVersion: 23C71
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.12.5
Code Snippet
# File: pages/home_page.py
class HomePage:
"""
Module description
"""
def __init__(self) -> None:
pass
def params_navigation(self):
"""
Method description
"""
print("params_navigation")
# File: tests/test_file_tests.py
class TestClassTest:
def test_without_method_definition(
self,
fixture_from_main,
fixture_from_tests,
):
fixture_from_main.params_navigation()
fixture_from_tests.params_navigation()
def test_with_method_definition(
fixture_from_main,
fixture_from_tests
):
fixture_from_main.params_navigation()
fixture_from_tests.params_navigation()
# File: tests/conftest.py
import pytest
from pages.home_page import HomePage
@pytest.fixture
def fixture_from_tests() -> HomePage:
return HomePage()
# File: tests/conftest.py
import pytest
from pages.home_page import HomePage
@pytest.fixture
def fixture_from_main() -> HomePage:
return HomePage()
# File: test_file_main.py
class TestClassTest:
def test_without_method_definition(
self,
fixture_from_main,
):
fixture_from_main.params_navigation()
def test_with_method_definition(fixture_from_main):
fixture_from_main.params_navigation()
Note that the HomePage class is initialized by a fixture in the conftest.py file and passed to the test functions.
Repro Steps
- Navigate to the test_file_tests.py or test_file_main.py file.
- Attempt to use "Go to Definition" on the params_navigation method call inside and outside the test methods.

Expected behavior
The "Go to Definition" should navigate to the params_navigation method definition in home_page.py.

Actual behavior
No navigation occurs.

Environment data
Code Snippet
Note that the HomePage class is initialized by a fixture in the conftest.py file and passed to the test functions.
Repro Steps
Expected behavior
The "Go to Definition" should navigate to the params_navigation method definition in home_page.py.

Actual behavior
No navigation occurs.
