[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libosinfo] [PATCH osinfo-db 13/15] tests: test_isoinfo: improve output on failure



This makes it easier to see exactly what test failed, and how

Signed-off-by: Cole Robinson <crobinso redhat com>
---
 tests/test_isoinfo.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/test_isoinfo.py b/tests/test_isoinfo.py
index 8809126..f5a15ba 100644
--- a/tests/test_isoinfo.py
+++ b/tests/test_isoinfo.py
@@ -55,11 +55,11 @@ def test_iso_detection(testdata):
                     if osxml2.shortid not in detected:
                         detected.append(osxml2.shortid)
 
-        if len(detected) != 1:
-            logging.warning('Some ISOs have been matched several times by '
-                            'the different OSes, which indicates an issue '
-                            'in the DB entries.')
-        assert len(detected) == 1
+        if detected == [osname]:
+            continue
+
+        raise AssertionError("isodata: %s\nMatched=%s but expected=%s" %
+                (isodatapath, detected, [osname]))
 
 
 class _ISODataMedia():
-- 
2.21.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]