]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: add topology name to assert output
authorRafael Zalamena <rzalamena@gmail.com>
Fri, 28 Jul 2017 00:44:51 +0000 (21:44 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:12 +0000 (20:22 -0500)
Make it easy to identify which topology test we are running.

tests/topotests/conftest.py

index 43f9516a11cb58622246880bb0193d37f7f39250..327e4625f2465647edb2d60a9c5b416411cc7e45 100755 (executable)
@@ -53,14 +53,16 @@ def pytest_runtest_makereport(item, call):
     if call.excinfo is None:
         return
 
+    parent = item.parent
+    modname = parent.module.__name__
+
     # Treat skips as non errors
     if call.excinfo.typename != 'AssertionError':
-        logger.info('assert skipped at "{}": {}'.format(
-            item.name, call.excinfo.value))
+        logger.info('assert skipped at "{}/{}": {}'.format(
+            modname, item.name, call.excinfo.value))
         return
 
     # Handle assert failures
-    parent = item.parent
     parent._previousfailed = item
-    logger.error('assert failed at "{}": {}'.format(
-        item.name, call.excinfo.value))
+    logger.error('assert failed at "{}/{}": {}'.format(
+        modname, item.name, call.excinfo.value))