From fe517fae74cffde4f821da499ed61a90d79b2519 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 29 Apr 2015 10:57:40 +0200 Subject: [PATCH 1/3] Use `desc_with_module` in "Builtin modules cannot be displayed" error --- jedi_vim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jedi_vim.py b/jedi_vim.py index 183c518..9f7aec7 100644 --- a/jedi_vim.py +++ b/jedi_vim.py @@ -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.") else: echo_highlight("Builtin modules cannot be displayed (%s)." - % d.module_path) + % d.desc_with_module) else: if d.module_path != vim.current.buffer.name: result = new_buffer(d.module_path) From a0bb09e89163859bf06ba98f110e02a3c31e61b5 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 29 Apr 2015 11:51:52 +0200 Subject: [PATCH 2/3] tests: use pytest.fail instead of `assert False` --- conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conftest.py b/conftest.py index 756bd6a..2efa682 100644 --- a/conftest.py +++ b/conftest.py @@ -3,6 +3,8 @@ import urllib import zipfile import subprocess +import pytest + CACHE_FOLDER = '.cache' VSPEC_FOLDER = os.path.join(CACHE_FOLDER, 'vim-vspec-master') VSPEC_RUNNER = os.path.join(VSPEC_FOLDER, 'bin/vspec') @@ -17,8 +19,8 @@ class IntegrationTestFile(object): output = subprocess.check_output([VSPEC_RUNNER, '.', VSPEC_FOLDER, self.path]) for line in output.splitlines(): if line.startswith(b'not ok') or line.startswith(b'Error'): - print(output.decode('utf-8')) - assert False + pytest.fail("{} failed:\n{}".format( + self.path, output.decode('utf-8')), pytrace=False) def __repr__(self): return "<%s: %s>" % (type(self), self.path) From ab04982d63974fc0389e10d38a7b3faa614db974 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 29 Apr 2015 11:52:36 +0200 Subject: [PATCH 3/3] pep8 fixes; sort imports --- conftest.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conftest.py b/conftest.py index 2efa682..1034182 100644 --- a/conftest.py +++ b/conftest.py @@ -1,7 +1,7 @@ import os +import subprocess import urllib import zipfile -import subprocess import pytest @@ -16,14 +16,15 @@ class IntegrationTestFile(object): self.path = path 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(): if line.startswith(b'not ok') or line.startswith(b'Error'): pytest.fail("{} failed:\n{}".format( self.path, output.decode('utf-8')), pytrace=False) def __repr__(self): - return "<%s: %s>" % (type(self), self.path) + return "<%s: %s>" % (type(self), self.path) def pytest_configure(config): @@ -38,7 +39,7 @@ def pytest_configure(config): dest = os.path.join(CACHE_FOLDER, n) destdir = os.path.dirname(dest) if not os.path.isdir(destdir): - os.makedirs(destdir) + os.makedirs(destdir) data = z.read(n) if not os.path.isdir(dest): with open(dest, 'w') as f: