Commits

David Chambers committed fc80e6b

Minor formatting changes.

Comments (0)

Files changed (1)

 import unittest
 
 import mango
-
 from mango.settings import PATH_TO_POSTS
 
 # Django already runs these, don't include them again
 
 def find_untested_modules(package):
 	""" Gets all modules not already included in Django's test suite """
-	files = [re.sub('\.py$', '', f) 
-			 for f in os.listdir(os.path.dirname(package.__file__))
-			 if f.endswith(".py") 
-			 and os.path.basename(f) not in ALREADY_RUN]
-	return [imp.load_module(file, *imp.find_module(file, package.__path__))
-			 for file in files]
+	files = []
+	for f in os.listdir(os.path.dirname(package.__file__)):
+		if f.endswith('.py') and os.path.basename(f) not in ALREADY_RUN:
+			files.append(re.sub(r'\.py$', '', f))
+	return [imp.load_module(f, *imp.find_module(f, package.__path__)) for f in files]
 
 def modules_callables(module):
 	return [m for m in dir(module) if callable(getattr(module, m))]
 
 def has_doctest(docstring):
-	return ">>>" in docstring
+	return '>>>' in docstring
 
 __test__ = {}
 for module in find_untested_modules(mango):
 	for method in modules_callables(module):
 		docstring = str(getattr(module, method).__doc__)
 		if has_doctest(docstring):
-			print "Mango Found doctest(s) " + module.__name__ + "." + method
+			print 'Mango found doctest: ' + module.__name__ + '.' + method
 
 			# import the method itself, so doctest can find it
 			_temp = __import__(module.__name__, globals(), locals(), [method])