python 2.5 compatibility

This commit is contained in:
David Halter
2012-09-06 02:35:38 +02:00
parent 8ebb1fbbfe
commit 0008e2c703
3 changed files with 16 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ import unittest
os.chdir(os.path.dirname(os.path.abspath(__file__)) + '/..')
sys.path.append('.')
from _compatibility import is_py25
import functions
#functions.set_debug_function(functions.debug.print_to_stdout)
@@ -56,7 +57,8 @@ class TestRegression(unittest.TestCase):
def test_keyword_doc(self):
r = list(self.get_def("or", (1,1)))
assert len(r) == 1
assert len(r[0].doc) > 100
if not is_py25:
assert len(r[0].doc) > 100
r = list(self.get_def("asfdasfd", (1,1)))
assert len(r) == 0
@@ -64,7 +66,8 @@ class TestRegression(unittest.TestCase):
def test_operator_doc(self):
r = list(self.get_def("a == b", (1,3)))
assert len(r) == 1
assert len(r[0].doc) > 100
if not is_py25:
assert len(r[0].doc) > 100
def test_get_definition_at_zero(self):
assert self.get_def("a", (1,1)) == set()