From c9ea51aa45a645857336b5a7645cebff3d9ece66 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sat, 21 Jan 2017 14:14:59 -0600 Subject: [PATCH] Add test for reproducible --version strings And add a release note to document the change. --- docs/source/release-notes/3.3.0.rst | 11 ++++++++++- tests/unit/test_option_manager.py | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/source/release-notes/3.3.0.rst b/docs/source/release-notes/3.3.0.rst index af62f6b..2a22906 100644 --- a/docs/source/release-notes/3.3.0.rst +++ b/docs/source/release-notes/3.3.0.rst @@ -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 `) -.. 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 diff --git a/tests/unit/test_option_manager.py b/tests/unit/test_option_manager.py index 661b445..3f210ae 100644 --- a/tests/unit/test_option_manager.py +++ b/tests/unit/test_option_manager.py @@ -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([