David Schneider committed 2992df9 Merge

merge default

Comments (0)

Files changed (1327)

 syntax: regexp


-greenlet = [svn]
-testrunner = [svn]
-lib_pypy/pyrepl = [svn]


-80037 greenlet
-80348 lib_pypy/pyrepl
-80037 testrunner
     Anders Qvist
     Alan McIntyre
     Bert Freudenberg
+    Tav
     Heinrich-Heine University, Germany 
     Open End AB (formerly AB Strakt), Sweden
     Impara, Germany
     Change Maker, Sweden 
+The PyPy Logo as used by and others was created
+by Samuel Reis and is distributed on terms of Creative Commons Share Alike
-License for 'lib-python/2.5.2' and 'lib-python/2.5.2-modified'
+License for 'lib-python/2.7.0' and 'lib-python/2.7.0-modified'
 Except when otherwise stated (look for LICENSE files or
 copyright/license information at the beginning of each file) the files
-in the 'lib-python/2.5.2' and 'lib-python/2.5.2-modified' directories
+in the 'lib-python/2.7.0' and 'lib-python/2.7.0-modified' directories
 are all copyrighted by the Python Software Foundation and licensed under
 the Python Software License of which you can find a copy here: 
 The following files are from the website of The Unicode Consortium
-at For the terms of use of these files, see
+at  For the terms of use of these files, see
+ .  Or they are derived from
+files from the above website, and the same terms of use apply.
-    CompositionExclusions-3.2.0.txt
-    CompositionExclusions-4.1.0.txt
-    CompositionExclusions-5.0.0.txt
-    EastAsianWidth-3.2.0.txt
-    EastAsianWidth-4.1.0.txt
-    EastAsianWidth-5.0.0.txt
-    UnicodeData-3.2.0.txt
-    UnicodeData-4.1.0.txt
-    UnicodeData-5.0.0.txt
-The following files are derived from files from the above website. The same
-terms of use apply.
-    UnihanNumeric-3.2.0.txt
-    UnihanNumeric-4.1.0.txt
-    UnihanNumeric-5.0.0.txt
+    CompositionExclusions-*.txt
+    EastAsianWidth-*.txt
+    LineBreak-*.txt
+    UnicodeData-*.txt
+    UnihanNumeric-*.txt
-PyPy: Python in Python implementation 
+PyPy: Python in Python Implementation 
 Welcome to PyPy!
-We invite you to head over to our detailed getting-started document:
-    pypy/doc/getting-started.html or
-    pypy/doc/getting-started.txt
-    (local if you got a source tarball or svn checkout)
+The getting-started document will help guide you:
-which gives you many good starting and entry points into playing with
-PyPy.  It will also point you to our documentation section which is
-generated from information in the pypy/doc directory.
-Enjoy and send us feedback!
+It will also point you to the rest of the documentation which is generated
+from files in the pypy/doc directory within the source repositories. Enjoy
+and send us feedback!
     the pypy-dev team <>


+__version__ = '2.0.3.dev3'


+support for presented detailed information in failing assertions.
+import py
+import sys
+from _pytest.monkeypatch import monkeypatch
+def pytest_addoption(parser):
+    group = parser.getgroup("debugconfig")
+    group._addoption('--no-assert', action="store_true", default=False,
+        dest="noassert",
+        help="disable python assert expression reinterpretation."),
+def pytest_configure(config):
+    # The _reprcompare attribute on the py.code module is used by
+    # py._code._assertionnew to detect this plugin was loaded and in
+    # turn call the hooks defined here as part of the
+    # DebugInterpreter.
+    config._monkeypatch = m = monkeypatch()
+    warn_about_missing_assertion()
+    if not config.getvalue("noassert") and not config.getvalue("nomagic"):
+        def callbinrepr(op, left, right):
+            hook_result = config.hook.pytest_assertrepr_compare(
+                config=config, op=op, left=left, right=right)
+            for new_expl in hook_result:
+                if new_expl:
+                    return '\n~'.join(new_expl)
+        m.setattr(py.builtin.builtins,
+                  'AssertionError', py.code._AssertionError)
+        m.setattr(py.code, '_reprcompare', callbinrepr)
+def pytest_unconfigure(config):
+    config._monkeypatch.undo()
+def warn_about_missing_assertion():
+    try:
+        assert False
+    except AssertionError:
+        pass
+    else:
+        sys.stderr.write("WARNING: failing tests may report as passing because "
+        "assertions are turned off!  (are you using python -O?)\n")
+# Provide basestring in python3
+    basestring = basestring
+except NameError:
+    basestring = str
+def pytest_assertrepr_compare(op, left, right):
+    """return specialised explanations for some operators/operands"""
+    width = 80 - 15 - len(op) - 2 # 15 chars indentation, 1 space around op
+    left_repr =, maxsize=int(width/2))
+    right_repr =, maxsize=width-len(left_repr))
+    summary = '%s %s %s' % (left_repr, op, right_repr)
+    issequence = lambda x: isinstance(x, (list, tuple))