[python-arrayfire] 127/250: Add proper logging to tests when in verbose mode
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Mar 28 22:59:39 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository python-arrayfire.
commit 4c3a2a61c6a8cb5e0ece14bced4ec8b33df45400
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Tue Nov 10 08:20:07 2015 -0500
Add proper logging to tests when in verbose mode
---
tests/simple/_util.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/simple/_util.py b/tests/simple/_util.py
index 911f220..7af1436 100644
--- a/tests/simple/_util.py
+++ b/tests/simple/_util.py
@@ -7,6 +7,8 @@
# http://arrayfire.com/licenses/BSD-3-Clause
########################################################
+import traceback
+import logging
import arrayfire as af
def display_func(verbose):
@@ -34,7 +36,6 @@ class _simple_test_dict(dict):
def run(self, name_list=None, verbose=False):
test_list = name_list if name_list is not None else self.keys()
for key in test_list:
-
try:
test = self[key]
except:
@@ -44,7 +45,10 @@ class _simple_test_dict(dict):
try:
test(verbose)
print(self.print_str % (key, "PASSED"))
- except:
+ except Exception as e:
print(self.print_str % (key, "FAILED"))
+ if (verbose):
+ logging.error(traceback.format_exc())
+
tests = _simple_test_dict()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-arrayfire.git
More information about the debian-science-commits
mailing list