Commit 3ea24543 authored by Jason R. Coombs's avatar Jason R. Coombs

Correction for expected dict order when PYTHONHASHSEED=0

parent 7ec2dd5e
......@@ -77,9 +77,9 @@ class egg_info(Command):
egg_info = odict()
# follow the order these keys would have been added
# when PYTHONHASHSEED=0
egg_info['tag_build'] = self.tags()
egg_info['tag_date'] = 0
egg_info['tag_svn_revision'] = 0
egg_info['tag_build'] = self.tags()
edit_config(filename, dict(egg_info=egg_info))
def finalize_options(self):
......
......@@ -84,7 +84,8 @@ class TestEggInfo(object):
assert 'tag_date = 0' in content
assert 'tag_svn_revision = 0' in content
expected_order = 'tag_date', 'tag_svn_revision', 'tag_build'
expected_order = 'tag_build', 'tag_date', 'tag_svn_revision'
self._validate_content_order(content, expected_order)
@staticmethod
......@@ -93,6 +94,10 @@ class TestEggInfo(object):
Assert that the strings in expected appear in content
in order.
"""
if sys.version_info < (2, 7):
# On Python 2.6, expect dict key order.
expected = dict.fromkeys(expected).keys()
pattern = '.*'.join(expected)
flags = re.MULTILINE | re.DOTALL
assert re.search(pattern, content, flags)
......@@ -129,11 +134,6 @@ class TestEggInfo(object):
expected_order = 'tag_build', 'tag_date', 'tag_svn_revision'
if sys.version_info < (2, 7):
# On Python 2.6, config gets overridden, retaining order
# from the dict.
expected_order = dict.fromkeys(expected_order).keys()
self._validate_content_order(content, expected_order)
def test_egg_base_installed_egg_info(self, tmpdir_cwd, env):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment