summaryrefslogtreecommitdiffstats
path: root/rtemsspec/tests/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'rtemsspec/tests/util.py')
-rw-r--r--rtemsspec/tests/util.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/rtemsspec/tests/util.py b/rtemsspec/tests/util.py
index d07df74c..ccece8e3 100644
--- a/rtemsspec/tests/util.py
+++ b/rtemsspec/tests/util.py
@@ -51,3 +51,10 @@ def create_item_cache_config_and_copy_spec(
else:
config["spec-type-root-uid"] = None
return config
+
+
+def get_and_clear_log(the_caplog) -> str:
+ log = "\n".join(f"{rec.levelname} {rec.message}"
+ for rec in the_caplog.records)
+ the_caplog.clear()
+ return log