FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-04-2012, 10:53 AM
Vratislav Podzimek
 
Default Fix traceback if modules cannot be loaded when running tests

---
tests/baseclass.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tests/baseclass.py b/tests/baseclass.py
index f8a5db2..a1b6e28 100644
--- a/tests/baseclass.py
+++ b/tests/baseclass.py
@@ -163,12 +163,16 @@ def loadModules(moduleDir, cls_pattern="_TestCase", skip_list=["__init__", "base
continue

# Attempt to load the found module.
+ loaded = None
try:
found = imputil.imp.find_module(module)
loaded = imputil.imp.load_module(module, found[0], found[1], found[2])
except ImportError, e:
print(_("Error loading module %s.") % module)

+ if not loaded:
+ continue
+
# Find class names that match the supplied pattern (default: "_TestCase")
beforeCount = len(tstList)
for obj in loaded.__dict__.keys():
--
1.7.4.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org