reportlab: another attempt at fixing testsFolder
authorrgbecker
Thu, 22 Jan 2009 15:55:13 +0000
changeset 3074 b7270812af81
parent 3073 6554a30b7450
child 3075 5175c093a0dd
reportlab: another attempt at fixing testsFolder
src/reportlab/lib/testutils.py
--- a/src/reportlab/lib/testutils.py	Thu Jan 22 15:07:50 2009 +0000
+++ b/src/reportlab/lib/testutils.py	Thu Jan 22 15:55:13 2009 +0000
@@ -61,7 +61,12 @@
     if not os.path.isdir(testsFolder):
         testsFolder = os.path.join(os.path.dirname(topDir),'tests')
     if not os.path.isdir(testsFolder):
-        testsFolder = None
+        if name=='__main__':
+            scriptDir=os.path.dirname(sys.argv[0])
+            if not scriptDir: scriptDir=os.getcwd()
+            testsFolder = os.path.abspath(scriptDir)
+        else:
+            testsFolder = None
     return _OUTDIR
 
 def outputfile(fn):