@@ -53,16 +53,17 @@ def smokeTest():
5353 if any (_ in root for _ in ("thirdparty" , "extra" )):
5454 continue
5555
56- for ifile in files :
57- length += 1
56+ for filename in files :
57+ if os .path .splitext (filename )[1 ].lower () == ".py" and filename != "__init__.py" :
58+ length += 1
5859
5960 for root , _ , files in os .walk (paths .SQLMAP_ROOT_PATH ):
6061 if any (_ in root for _ in ("thirdparty" , "extra" )):
6162 continue
6263
63- for ifile in files :
64- if os .path .splitext (ifile )[1 ].lower () == ".py" and ifile != "__init__.py" :
65- path = os .path .join (root , os .path .splitext (ifile )[0 ])
64+ for filename in files :
65+ if os .path .splitext (filename )[1 ].lower () == ".py" and filename != "__init__.py" :
66+ path = os .path .join (root , os .path .splitext (filename )[0 ])
6667 path = path .replace (paths .SQLMAP_ROOT_PATH , '.' )
6768 path = path .replace (os .sep , '.' ).lstrip ('.' )
6869 try :
@@ -71,7 +72,7 @@ def smokeTest():
7172 except Exception , msg :
7273 retVal = False
7374 dataToStdout ("\r " )
74- errMsg = "smoke test failed at importing module '%s' (%s):\n %s" % (path , os .path .join (root , ifile ), msg )
75+ errMsg = "smoke test failed at importing module '%s' (%s):\n %s" % (path , os .path .join (root , filename ), msg )
7576 logger .error (errMsg )
7677 else :
7778 # Run doc tests
@@ -80,9 +81,9 @@ def smokeTest():
8081 if failure_count > 0 :
8182 retVal = False
8283
83- count += 1
84- status = '%d/%d (%d%%) ' % (count , length , round (100.0 * count / length ))
85- dataToStdout ("\r [%s] [INFO] complete: %s" % (time .strftime ("%X" ), status ))
84+ count += 1
85+ status = '%d/%d (%d%%) ' % (count , length , round (100.0 * count / length ))
86+ dataToStdout ("\r [%s] [INFO] complete: %s" % (time .strftime ("%X" ), status ))
8687
8788 clearConsoleLine ()
8889 if retVal :
0 commit comments