[pypy-commit] pypy release-2.0-beta1: Fix test_version: give PYPY_VERSION a format following the standard,

arigo noreply at buildbot.pypy.org
Wed Nov 14 15:11:11 CET 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: release-2.0-beta1
Changeset: r58888:7e4f0faa3d51
Date: 2012-11-14 15:10 +0100
http://bitbucket.org/pypy/pypy/changeset/7e4f0faa3d51/

Log:	Fix test_version: give PYPY_VERSION a format following the standard,
	and fix the test to correctly expect the "-beta1".

diff --git a/pypy/module/cpyext/include/patchlevel.h b/pypy/module/cpyext/include/patchlevel.h
--- a/pypy/module/cpyext/include/patchlevel.h
+++ b/pypy/module/cpyext/include/patchlevel.h
@@ -29,7 +29,7 @@
 #define PY_VERSION		"2.7.3"
 
 /* PyPy version as a string */
-#define PYPY_VERSION "2.0beta1"
+#define PYPY_VERSION "2.0.0-beta1"
 
 /* Subversion Revision number of this file (not of the repository).
  * Empty since Mercurial migration. */
diff --git a/pypy/module/cpyext/test/test_version.py b/pypy/module/cpyext/test/test_version.py
--- a/pypy/module/cpyext/test/test_version.py
+++ b/pypy/module/cpyext/test/test_version.py
@@ -14,4 +14,8 @@
         """
         module = self.import_module(name='foo', init=init)
         assert module.py_version == sys.version[:5]
-        assert module.pypy_version == '%d.%d.%d' % sys.pypy_version_info[:3]
+        v = sys.pypy_version_info
+        s = '%d.%d.%d' % (v[0], v[1], v[2])
+        if v.releaselevel != 'final':
+            s += '-%s%d' % (v[3], v[4])
+        assert module.pypy_version == s


More information about the pypy-commit mailing list