[Python-checkins] cpython: Add tests for comparing candidate and final versions in packaging (#11841).

eric.araujo python-checkins at python.org
Thu Oct 6 13:24:07 CEST 2011


http://hg.python.org/cpython/rev/2105ab8553b7
changeset:   72731:2105ab8553b7
user:        Éric Araujo <merwok at netwok.org>
date:        Wed Oct 05 01:41:14 2011 +0200
summary:
  Add tests for comparing candidate and final versions in packaging (#11841).

This used to be buggy; Filip Gruszczyński contributed tests and a code
patch but the latter is not needed.

files:
  Lib/packaging/tests/test_version.py |  12 ++++++++++++
  1 files changed, 12 insertions(+), 0 deletions(-)


diff --git a/Lib/packaging/tests/test_version.py b/Lib/packaging/tests/test_version.py
--- a/Lib/packaging/tests/test_version.py
+++ b/Lib/packaging/tests/test_version.py
@@ -101,8 +101,18 @@
         True
         >>> V('1.2.0') >= V('1.2.3')
         False
+        >>> V('1.2.0rc1') >= V('1.2.0')
+        False
         >>> (V('1.0') > V('1.0b2'))
         True
+        >>> V('1.0') > V('1.0c2')
+        True
+        >>> V('1.0') > V('1.0rc2')
+        True
+        >>> V('1.0rc2') > V('1.0rc1')
+        True
+        >>> V('1.0c4') > V('1.0c1')
+        True
         >>> (V('1.0') > V('1.0c2') > V('1.0c1') > V('1.0b2') > V('1.0b1')
         ...  > V('1.0a2') > V('1.0a1'))
         True
@@ -129,6 +139,8 @@
         ...  < V('1.0.dev18')
         ...  < V('1.0.dev456')
         ...  < V('1.0.dev1234')
+        ...  < V('1.0rc1')
+        ...  < V('1.0rc2')
         ...  < V('1.0')
         ...  < V('1.0.post456.dev623')  # development version of a post release
         ...  < V('1.0.post456'))

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list