From a0bb09e89163859bf06ba98f110e02a3c31e61b5 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 29 Apr 2015 11:51:52 +0200 Subject: [PATCH] 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)