forked from VimPlug/jedi-vim
Merge pull request #395 from blueyed/improve-tests
Improve tests: use pytest.fail
This commit is contained in:
11
conftest.py
11
conftest.py
@@ -1,7 +1,9 @@
|
|||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import urllib
|
import urllib
|
||||||
import zipfile
|
import zipfile
|
||||||
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')
|
||||||
@@ -14,11 +16,12 @@ 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)
|
||||||
|
|||||||
Reference in New Issue
Block a user