[pypy-svn] pypy commit dc0455b76944: Add a (broken) test

Bitbucket commits-noreply at bitbucket.org
Tue Dec 14 20:37:16 CET 2010


# HG changeset patch -- Bitbucket.org
# Project pypy
# URL http://bitbucket.org/pypy/pypy/overview
# User Maciej Fijalkowski <fijall at gmail.com>
# Date 1292355417 -7200
# Node ID dc0455b76944e41e0a9fec2f3436d69fb2ede5db
# Parent  1ea96e93e1ba5fbc5337685fa00514b1e904da3f
Add a (broken) test

--- a/pypy/tool/version.py
+++ b/pypy/tool/version.py
@@ -4,13 +4,13 @@ from subprocess import Popen, PIPE
 import pypy
 pypydir = os.path.dirname(os.path.abspath(pypy.__file__))
 
-
-def get_mercurial_info():
+def get_mercurial_info(hgexe=None):
     '''Obtain Mercurial version information by invoking the 'hg' command.'''
     # TODO: support extracting from .hg_archival.txt
 
     pypyroot = os.path.abspath(os.path.join(pypydir, '..'))
-    hgexe = py.path.local.sysfind('hg')
+    if hgexe is None:
+        hgexe = py.path.local.sysfind('hg')
 
     def maywarn(err):
         if not err:

--- /dev/null
+++ b/pypy/tool/test/test_version.py
@@ -0,0 +1,5 @@
+
+from pypy.tool.version import get_mercurial_info
+
+def test_get_mercurial_info():
+    assert get_mercurial_info('completely broken mercurial')



More information about the Pypy-commit mailing list