summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-07-04 08:21:45 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-07-04 08:21:45 +0200
commitb59b48a3a2386cebee3f61a82cc3255d9646752c (patch)
treeb6e1a6450722805f27c4ac420189a989dfdd844c
parentf09f3ae99d3699c652026f310b807e979896a3a0 (diff)
downloadxdd2esi-b59b48a3a2386cebee3f61a82cc3255d9646752c.tar.gz
xdd2esi-b59b48a3a2386cebee3f61a82cc3255d9646752c.zip
test.py cleanup
-rw-r--r--test.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/test.py b/test.py
index efaefa2..52514cb 100644
--- a/test.py
+++ b/test.py
@@ -15,8 +15,6 @@ import warnings
import logging
import collections
-warncount = 0
-
def parseargs():
""" Parse the command-line arguments """
parser = argparse.ArgumentParser(
@@ -36,8 +34,9 @@ def parseargs():
def init():
""" Initializes this module """
options = parseargs()
- logging.disable(logging.ERROR)
- warnings.simplefilter("always")
+ logging.disable(logging.ERROR) # Don't output logging messages with a
+ # level more verbose than ERROR
+ warnings.simplefilter("always") # Issue all warnings
return options
def main():
@@ -76,19 +75,21 @@ def main():
print('{:40.40} {}{}'.format(xdd, failpass, warncnt))
w_msgs = []
for warning in w:
- w_msgs.append((str(warning.category.__name__), str(warning.message)))
+ w_msgs.append((str(warning.category.__name__),
+ str(warning.message)))
for warning in collections.Counter(w_msgs).items():
count = warning[1]
if count == 1:
countstr = "{} time".format(count)
else:
countstr = "{} times".format(count)
- print(" {:8} {:30} {}".format(countstr, warning[0][0], warning[0][1]))
+ print(" {:8} {:30} {}".format(countstr, warning[0][0],
+ warning[0][1]))
if exception is not None:
print(" {}".format(exception))
if failpass != "PASS" or warncnt != '':
- print(" xdd2esi.py --force --dry-run --loglevel=debug --template "
- "{} --schema {} {} -".format(
+ print(" xdd2esi.py --force --dry-run --loglevel=debug"
+ " --template {} --schema {} {} -".format(
os.path.join(options.xddfolder, options.template),
os.path.join(options.xddfolder, options.schema),
os.path.join(options.xddfolder, xdd)))