Permalink
Browse files

ordereddict imports for py2.6

  • Loading branch information...
domenkozar committed Dec 30, 2012
1 parent ab9db5a commit b3ee8845ec4f0ffce1d22e5b3cf13864dc35aba5
Showing with 6 additions and 3 deletions.
  1. +6 −3 mrbob/tests/test_parsing.py
@@ -3,7 +3,10 @@
import unittest
import tempfile
import codecs
-import collections
+try: # pragma: no cover
+ from collections import OrderedDict # NOQA
+except ImportError: # pragma: no cover
+ from ordereddict import OrderedDict # NOQA
import six
@@ -211,12 +214,12 @@ def test_overwrite_dict_with_value(self):
""" providing a value for a key that already contains a
dictionary raises a ConfigurationError """
from ..configurator import ConfigurationError
- d = collections.OrderedDict([('foo.bar', '1'), ('foo', '2')])
+ d = OrderedDict([('foo.bar', '1'), ('foo', '2')])
self.assertRaises(ConfigurationError, self.call_FUT, d)
def test_overwrite_value_with_dict(self):
""" providing a dict for a key that already contains a
string raises a ConfigurationError """
from ..configurator import ConfigurationError
- d = collections.OrderedDict([('foo', '2'), ('foo.bar', '1')])
+ d = OrderedDict([('foo', '2'), ('foo.bar', '1')])
self.assertRaises(ConfigurationError, self.call_FUT, d)

0 comments on commit b3ee884

Please sign in to comment.