2.6 fixes

This commit is contained in:
Mahmoud Hashemi 2015-05-17 22:34:49 -07:00
parent 5db8df959b
commit ed378df313
2 changed files with 15 additions and 3 deletions

View File

@ -182,7 +182,11 @@ def test_poplast():
def test_reversed():
from collections import OrderedDict
try:
from collections import OrderedDict
except:
# skip on python 2.6
return
for items in _ITEMSETS:
omd = OMD(items)
od = OrderedDict(items)

View File

@ -28,8 +28,16 @@ _TEST_TMPLS = ["example 1: {hello}",
"example 2: {hello:*10}",
"example 3: {hello:*{width}}",
"example 4: {hello!r:{fchar}{width}}, {width}, yes",
"example 5: {0}, {1:d}, {2:f}, {1}",
"example 6: {}, {}, {}, {1}"]
"example 5: {0}, {1:d}, {2:f}, {1}"]
try:
from collections import OrderedDict
except ImportError:
pass # skip the non-2.6 compatible tests on 2.6
else:
_TEST_TMPLS.append("example 6: {}, {}, {}, {1}")
finally:
del OrderedDict
def test_get_fstr_args():