diff options
author | R. Tyler Ballance <tyler@slide.com> | 2009-05-31 20:50:28 -0700 |
---|---|---|
committer | R. Tyler Ballance <tyler@slide.com> | 2009-05-31 20:50:28 -0700 |
commit | 30434054d6bd171823be0f7813b9c99f2e6c0898 (patch) | |
tree | b6a7092ed27b0e45cadbbd250e74e623464746b1 | |
parent | c18ea256f5eac32c2b91f2bfa00673f3827d99d5 (diff) | |
download | python-cheetah-30434054d6bd171823be0f7813b9c99f2e6c0898.tar.gz |
Disable the decorator tests added on Python 2.3 since they're irrelevant
Signed-off-by: R. Tyler Ballance <tyler@slide.com>
-rw-r--r-- | src/Tests/Filters.py | 5 | ||||
-rw-r--r-- | src/Tests/Regressions.py | 15 | ||||
-rw-r--r-- | src/Tests/SyntaxAndOutput.py | 13 |
3 files changed, 21 insertions, 12 deletions
diff --git a/src/Tests/Filters.py b/src/Tests/Filters.py index 04afdd5..bf35440 100644 --- a/src/Tests/Filters.py +++ b/src/Tests/Filters.py @@ -7,6 +7,9 @@ import Cheetah.Filters import unittest_local_copy as unittest +majorVer, minorVer = sys.version_info[0], sys.version_info[1] +versionTuple = (majorVer, minorVer) + class BasicMarkdownFilterTest(unittest.TestCase): ''' Test that our markdown filter works @@ -27,7 +30,7 @@ Header template = str(template) assert template == expected except Exception, ex: - if ex.__class__.__name__ == 'MarkdownException' and sys.version_info[0] == 2 and sys.version_info[1] < 5: + if ex.__class__.__name__ == 'MarkdownException' and majorVer == 2 and minorVer < 5: print '>>> NOTE: Support for the Markdown filter will be broken for you. Markdown says: %s' % ex return raise diff --git a/src/Tests/Regressions.py b/src/Tests/Regressions.py index ee6c943..8e7b4b9 100644 --- a/src/Tests/Regressions.py +++ b/src/Tests/Regressions.py @@ -2,10 +2,19 @@ import Cheetah.NameMapper import Cheetah.Template + import pdb +import sys import unittest_local_copy as unittest # This is just stupid +majorVer, minorVer = sys.version_info[0], sys.version_info[1] +versionTuple = (majorVer, minorVer) + +def isPython23(): + ''' Python 2.3 is still supported by Cheetah, but doesn't support decorators ''' + return majorVer == 2 and minorVer < 4 + class GetAttrException(Exception): pass @@ -147,6 +156,8 @@ class Mantis_Issue_21_Regression_Test(unittest.TestCase): when using the NameMapper ''' def runTest(self): + if isPython23(): + return template = ''' #@staticmethod #def testMethod() @@ -168,6 +179,8 @@ class Mantis_Issue_22_Regression_Test(unittest.TestCase): on the `self` local, breaking the function ''' def test_NoneFilter(self): + if isPython23(): + return template = ''' #@staticmethod #def testMethod() @@ -181,6 +194,8 @@ class Mantis_Issue_22_Regression_Test(unittest.TestCase): assert template.testMethod(output='bug') def test_DefinedFilter(self): + if isPython23(): + return template = ''' #@staticmethod #def testMethod() diff --git a/src/Tests/SyntaxAndOutput.py b/src/Tests/SyntaxAndOutput.py index 059d7e1..78e0cc5 100644 --- a/src/Tests/SyntaxAndOutput.py +++ b/src/Tests/SyntaxAndOutput.py @@ -33,21 +33,12 @@ from Cheetah.Parser import ParseError from Cheetah.Compiler import Compiler, DEFAULT_COMPILER_SETTINGS import unittest_local_copy as unittest -class Unspecified: pass -################################################## -## CONSTANTS & GLOBALS ## +class Unspecified(object): + pass majorVer, minorVer = sys.version_info[0], sys.version_info[1] versionTuple = (majorVer, minorVer) -try: - True,False -except NameError: - True, False = (1==1),(1==0) - -################################################## -## TEST DATA FOR USE IN THE TEMPLATES ## - def testdecorator(func): return func |