mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 19:24:36 +08:00
tests: use pytest.fail instead of assert False
This commit is contained in:
@@ -3,6 +3,8 @@ import urllib
|
|||||||
import zipfile
|
import zipfile
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
CACHE_FOLDER = '.cache'
|
CACHE_FOLDER = '.cache'
|
||||||
VSPEC_FOLDER = os.path.join(CACHE_FOLDER, 'vim-vspec-master')
|
VSPEC_FOLDER = os.path.join(CACHE_FOLDER, 'vim-vspec-master')
|
||||||
VSPEC_RUNNER = os.path.join(VSPEC_FOLDER, 'bin/vspec')
|
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])
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user