You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by ch...@apache.org on 2025/05/12 05:36:14 UTC
(fury) 08/09: print python tests exception
This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch releases-0.10
in repository https://gitbox.apache.org/repos/asf/fury.git
commit 85e7b121808ec4be64bb1912e109fd43b2e283bf
Author: chaokunyang <sh...@gmail.com>
AuthorDate: Mon May 12 11:39:50 2025 +0800
print python tests exception
---
python/pyfury/tests/test_cross_language.py | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/python/pyfury/tests/test_cross_language.py b/python/pyfury/tests/test_cross_language.py
index 9c0cc93e..141a356f 100644
--- a/python/pyfury/tests/test_cross_language.py
+++ b/python/pyfury/tests/test_cross_language.py
@@ -18,6 +18,7 @@
import array
import datetime
import math
+import logging
import os
import typing
@@ -616,12 +617,23 @@ def test_oob_buffer(in_band_file_path, out_of_band_file_path):
f.write(out_of_band_buffer.to_bytes(0, out_of_band_buffer.writer_index))
+_LOGGER_FORMAT = (
+ "%(asctime)s\t%(levelname)s %(filename)s:%(lineno)s -- %(process)d -- %(message)s"
+)
+
+
if __name__ == "__main__":
import sys
- args = sys.argv[1:]
- assert len(args) > 0
- func = getattr(sys.modules[__name__], args[0])
- if not func:
- raise Exception("Unknown args {}".format(args))
- func(*args[1:])
+ logging.basicConfig(format=_LOGGER_FORMAT, level=logging.INFO)
+ print(f"Execute {sys.argv}")
+ try:
+ args = sys.argv[1:]
+ assert len(args) > 0
+ func = getattr(sys.modules[__name__], args[0])
+ if not func:
+ raise Exception("Unknown args {}".format(args))
+ func(*args[1:])
+ except BaseException as e:
+ logging.exception("Execute %s failed with %s", args, e)
+ raise
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org