Add test for reproducible --version strings

And add a release note to document the change.
This commit is contained in:
Ian Cordasco 2017-01-21 14:14:59 -06:00
parent f0f2ea7f4e
commit c9ea51aa45
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
2 changed files with 27 additions and 1 deletions

View file

@ -19,9 +19,14 @@ You can view the `3.3.0 milestone`_ on GitLab for more details.
- Added unique error codes for all missing PyFlakes messages (14 new
codes, see all :ref:`Error / Violation Codes <error_codes>`)
.. links
- Force ``flake8 --version`` to be repeatable between invocations. (See also
`GitLab#297`_)
.. all links
.. _3.3.0 milestone:
https://gitlab.com/pycqa/flake8/milestones/16
.. issue links
.. _GitLab#244:
https://gitlab.com/pycqa/flake8/issues/244
.. _GitLab#251:
@ -30,5 +35,9 @@ You can view the `3.3.0 milestone`_ on GitLab for more details.
https://gitlab.com/pycqa/flake8/issues/268
.. _GitLab#290:
https://gitlab.com/pycqa/flake8/issues/290
.. _GitLab#297:
https://gitlab.com/pycqa/flake8/issues/297
.. merge request links
.. _GitLab!156:
https://gitlab.com/pycqa/flake8/merge_requests/156

View file

@ -137,6 +137,23 @@ def test_generate_versions(optmanager):
'Testing 100: 0.0.0, Testing 101: 0.0.0, Testing 300: 0.0.0')
def test_plugins_are_sorted_in_generate_versions(optmanager):
"""Verify we sort before joining strings in generate_versions."""
optmanager.registered_plugins = [
('pyflakes', '1.5.0'),
('mccabe', '0.7.0'),
('pycodestyle', '2.2.0'),
('flake8-docstrings', '0.6.1'),
('flake8-bugbear', '2016.12.1'),
]
assert (optmanager.generate_versions() ==
'flake8-bugbear: 2016.12.1, '
'flake8-docstrings: 0.6.1, '
'mccabe: 0.7.0, '
'pycodestyle: 2.2.0, '
'pyflakes: 1.5.0')
def test_generate_versions_with_format_string(optmanager):
"""Verify a comma-separated string is generated of registered plugins."""
optmanager.registered_plugins.update([