CheetahWrapper.py (cheetah3-3.2.2) | : | CheetahWrapper.py (cheetah3-3.2.3) | ||
---|---|---|---|---|
#!/usr/bin/env python | ||||
import codecs | import codecs | |||
import glob | import glob | |||
import os | import os | |||
import pprint | import pprint | |||
import re | import re | |||
import shutil | import shutil | |||
import sys | import sys | |||
try: | try: | |||
import cPickle as pickle | import cPickle as pickle | |||
skipping to change at line 277 | skipping to change at line 278 | |||
f = open(TEST_WRITE_FILENAME, 'w') | f = open(TEST_WRITE_FILENAME, 'w') | |||
except Exception: | except Exception: | |||
sys.exit("""\ | sys.exit("""\ | |||
Cannot run the tests because you don't have write permission in the current | Cannot run the tests because you don't have write permission in the current | |||
directory. The tests need to create temporary files. Change to a directory | directory. The tests need to create temporary files. Change to a directory | |||
you do have write permission to and re-run the tests.""") | you do have write permission to and re-run the tests.""") | |||
else: | else: | |||
f.close() | f.close() | |||
os.remove(TEST_WRITE_FILENAME) | os.remove(TEST_WRITE_FILENAME) | |||
# @@MO: End ugly kludge. | # @@MO: End ugly kludge. | |||
from Cheetah.Tests import Test | ||||
import unittest | import unittest | |||
from Cheetah.Tests import Test | ||||
verbosity = 1 | verbosity = 1 | |||
if '-q' in self.testOpts: | if '-q' in self.testOpts: | |||
verbosity = 0 | verbosity = 0 | |||
if '-v' in self.testOpts: | if '-v' in self.testOpts: | |||
verbosity = 2 | verbosity = 2 | |||
runner = unittest.TextTestRunner(verbosity=verbosity) | runner = unittest.TextTestRunner(verbosity=verbosity) | |||
runner.run(unittest.TestSuite(Test.suites)) | ||||
results = runner.run(unittest.TestSuite(Test.suites)) | results = runner.run(unittest.TestSuite(Test.suites)) | |||
exit(int(not results.wasSuccessful())) | exit(int(not results.wasSuccessful())) | |||
def version(self): | def version(self): | |||
print(Version) | print(Version) | |||
# If you add a command, also add it to the 'meths' variable in main(). | # If you add a command, also add it to the 'meths' variable in main(). | |||
################################################## | ################################################## | |||
# LOGGING METHODS | # LOGGING METHODS | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |