diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-04-20 09:47:13 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-04-20 09:47:13 -0400 |
commit | 66932720c96591ea74015844d713cd5724f4e8af (patch) | |
tree | 286a6a287265c1b044ad8da8f1c6f64add80cecb /setuptools/tests/test_egg_info.py | |
parent | 46b76edc1e451276e1fb9e31c90c311898486de3 (diff) | |
download | external_python_setuptools-66932720c96591ea74015844d713cd5724f4e8af.tar.gz external_python_setuptools-66932720c96591ea74015844d713cd5724f4e8af.tar.bz2 external_python_setuptools-66932720c96591ea74015844d713cd5724f4e8af.zip |
Move Python 2.6 exception into specific test, capturing that the expected order is different on Python 2.6, not because of the lack of OrderedDict, but because of different behavior in RawConfigParser. Ref #553.
Diffstat (limited to 'setuptools/tests/test_egg_info.py')
-rw-r--r-- | setuptools/tests/test_egg_info.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index efe61eea..76569c30 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -87,12 +87,12 @@ class TestEggInfo(object): self._validate_content_order(content, expected_order) @staticmethod - def _validate_content_order(content, expected_order): - if sys.version_info < (2, 7): - # order cannot be guaranteed on Python 2.6 - return - - pattern = '.*'.join(expected_order) + def _validate_content_order(content, expected): + """ + Assert that the strings in expected appear in content + in order. + """ + pattern = '.*'.join(expected) flags = re.MULTILINE | re.DOTALL assert re.search(pattern, content, flags) @@ -120,6 +120,12 @@ class TestEggInfo(object): assert 'tag_svn_revision = 0' in content 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): |