mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Implement all remaining Path issues and use it instead of strings
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from pathlib import Path
|
||||
|
||||
from parso.python.tree import search_ancestor
|
||||
from jedi.inference.cache import inference_state_method_cache
|
||||
from jedi.inference.imports import load_module_from_path
|
||||
@@ -128,7 +130,7 @@ def _iter_pytest_modules(module_context, skip_own_module=False):
|
||||
sys_path = module_context.inference_state.get_sys_path()
|
||||
while any(folder.path.startswith(p) for p in sys_path):
|
||||
file_io = folder.get_file_io('conftest.py')
|
||||
if file_io.path != module_context.py__file__():
|
||||
if Path(file_io.path) != module_context.py__file__():
|
||||
try:
|
||||
m = load_module_from_path(module_context.inference_state, file_io)
|
||||
yield m.as_context()
|
||||
|
||||
Reference in New Issue
Block a user