mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 11:34:51 +08:00
Merge remote-tracking branch 'origin/dev'
This commit is contained in:
15
conftest.py
15
conftest.py
@@ -1,7 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import urllib
|
import urllib
|
||||||
import zipfile
|
import zipfile
|
||||||
import subprocess
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
VSPEC_URL = 'https://github.com/kana/vim-vspec/archive/1.4.1.zip'
|
VSPEC_URL = 'https://github.com/kana/vim-vspec/archive/1.4.1.zip'
|
||||||
CACHE_FOLDER = '.cache'
|
CACHE_FOLDER = '.cache'
|
||||||
@@ -15,14 +17,15 @@ class IntegrationTestFile(object):
|
|||||||
self.path = path
|
self.path = path
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
output = subprocess.check_output([VSPEC_RUNNER, '.', VSPEC_FOLDER, self.path])
|
output = subprocess.check_output(
|
||||||
|
[VSPEC_RUNNER, '.', VSPEC_FOLDER, self.path])
|
||||||
for line in output.splitlines():
|
for line in output.splitlines():
|
||||||
if line.startswith(b'not ok') or line.startswith(b'Error'):
|
if line.startswith(b'not ok') or line.startswith(b'Error'):
|
||||||
print(output.decode('utf-8'))
|
pytest.fail("{} failed:\n{}".format(
|
||||||
assert False
|
self.path, output.decode('utf-8')), pytrace=False)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<%s: %s>" % (type(self), self.path)
|
return "<%s: %s>" % (type(self), self.path)
|
||||||
|
|
||||||
|
|
||||||
def pytest_configure(config):
|
def pytest_configure(config):
|
||||||
@@ -36,7 +39,7 @@ def pytest_configure(config):
|
|||||||
dest = os.path.join(CACHE_FOLDER, n)
|
dest = os.path.join(CACHE_FOLDER, n)
|
||||||
destdir = os.path.dirname(dest)
|
destdir = os.path.dirname(dest)
|
||||||
if not os.path.isdir(destdir):
|
if not os.path.isdir(destdir):
|
||||||
os.makedirs(destdir)
|
os.makedirs(destdir)
|
||||||
data = z.read(n)
|
data = z.read(n)
|
||||||
if not os.path.isdir(dest):
|
if not os.path.isdir(dest):
|
||||||
with open(dest, 'w') as f:
|
with open(dest, 'w') as f:
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False):
|
|||||||
echo_highlight("Cannot get the definition of Python keywords.")
|
echo_highlight("Cannot get the definition of Python keywords.")
|
||||||
else:
|
else:
|
||||||
echo_highlight("Builtin modules cannot be displayed (%s)."
|
echo_highlight("Builtin modules cannot be displayed (%s)."
|
||||||
% d.module_path)
|
% d.desc_with_module)
|
||||||
else:
|
else:
|
||||||
if d.module_path != vim.current.buffer.name:
|
if d.module_path != vim.current.buffer.name:
|
||||||
result = new_buffer(d.module_path)
|
result = new_buffer(d.module_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user