mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
sys_path: order egg-link files for reproducible test results
This commit is contained in:
@@ -35,7 +35,10 @@ def _get_sys_path_with_egglinks(sys_path):
|
|||||||
result = []
|
result = []
|
||||||
for p in sys_path:
|
for p in sys_path:
|
||||||
result.append(p)
|
result.append(p)
|
||||||
for egg_link in glob.glob(os.path.join(p, '*.egg-link')):
|
# pkg_resources does not define a specific order for egg-link files
|
||||||
|
# using os.listdir to enumerate them, we're sorting them to have
|
||||||
|
# reproducible tests.
|
||||||
|
for egg_link in sorted(glob.glob(os.path.join(p, '*.egg-link'))):
|
||||||
with open(egg_link) as fd:
|
with open(egg_link) as fd:
|
||||||
for line in fd:
|
for line in fd:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ def test_get_venv_path(venv):
|
|||||||
glob(pjoin(venv, 'lib', 'site-packages')))[0]
|
glob(pjoin(venv, 'lib', 'site-packages')))[0]
|
||||||
ETALON = [
|
ETALON = [
|
||||||
site_pkgs,
|
site_pkgs,
|
||||||
pjoin(site_pkgs, '.', 'relative', 'egg-link', 'path'),
|
|
||||||
pjoin('/path', 'from', 'egg-link'),
|
pjoin('/path', 'from', 'egg-link'),
|
||||||
|
pjoin(site_pkgs, '.', 'relative', 'egg-link', 'path'),
|
||||||
pjoin(site_pkgs, 'dir-from-foo-pth'),
|
pjoin(site_pkgs, 'dir-from-foo-pth'),
|
||||||
pjoin('/path', 'from', 'smth.py'),
|
pjoin('/path', 'from', 'smth.py'),
|
||||||
pjoin('/path', 'from', 'smth.py:extend_path')
|
pjoin('/path', 'from', 'smth.py:extend_path')
|
||||||
|
|||||||
Reference in New Issue
Block a user