summaryrefslogtreecommitdiffstats
path: root/tests/topotests/conftest.py
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@gmail.com>2017-07-28 02:44:51 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-11-28 02:22:12 +0100
commit5684f8100dc86d2d31264ec22637c21222437b22 (patch)
treefdb4b441a9f1a2457871d89ef7ff9e8e79899290 /tests/topotests/conftest.py
parenttopotests: make asserts show up in stderr (diff)
downloadfrr-5684f8100dc86d2d31264ec22637c21222437b22.tar.xz
frr-5684f8100dc86d2d31264ec22637c21222437b22.zip
topotests: add topology name to assert output
Make it easy to identify which topology test we are running.
Diffstat (limited to 'tests/topotests/conftest.py')
-rwxr-xr-xtests/topotests/conftest.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/topotests/conftest.py b/tests/topotests/conftest.py
index 43f9516a1..327e4625f 100755
--- a/tests/topotests/conftest.py
+++ b/tests/topotests/conftest.py
@@ -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))