tests: virtconvtest: Accumulate more errors before exiting

This commit is contained in:
Cole Robinson 2018-02-13 16:31:38 -05:00
parent a9596c7492
commit fe728f899d

View File

@ -78,8 +78,16 @@ class TestVirtConv(unittest.TestCase):
if not os.path.exists(in_dir): if not os.path.exists(in_dir):
raise RuntimeError("Directory does not exist: %s" % in_dir) raise RuntimeError("Directory does not exist: %s" % in_dir)
err = ""
for in_path in glob.glob(os.path.join(in_dir, "*")): for in_path in glob.glob(os.path.join(in_dir, "*")):
try:
self._compare_single_file(in_path, in_type) self._compare_single_file(in_path, in_type)
except Exception:
import traceback
err += traceback.format_exc()
if err:
raise AssertionError("Errors encountered:\n%s" % err)
def testOVF2Libvirt(self): def testOVF2Libvirt(self):
self._compare_files("ovf") self._compare_files("ovf")