diff --git a/conftest.py b/conftest.py index 756bd6a..1034182 100644 --- a/conftest.py +++ b/conftest.py @@ -1,7 +1,9 @@ import os +import subprocess import urllib import zipfile -import subprocess + +import pytest CACHE_FOLDER = '.cache' VSPEC_FOLDER = os.path.join(CACHE_FOLDER, 'vim-vspec-master') @@ -14,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'): - 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) + return "<%s: %s>" % (type(self), self.path) def pytest_configure(config): @@ -36,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: