src/reportlab/lib/testutils.py
changeset 3074 b7270812af81
parent 3055 af8146d7cf65
child 3076 6a959200100d
--- 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):