tests: fix readline escape characters in heredoctest.py/test-url.py
This fix mirrors the changes made to test-doctest.py in b856071435f7
and 967adcf5910d.
Without this change, tests running heredoctest.py can fail on certain
versions of OS X when TERM is set to xterm-256color:
$ /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -m heredoctest <<EOF
> >>> open('b', 'w').write('this' * 1000)
> EOF
+ \x1b[?1034h (no-eol) (esc)
A similar problem occurs with test-url.py:
$ ./run-tests.py test-url.py
--- .../tests/test-url.py.out
+++ .../tests/test-url.py.err
@@ -0,0 +1 @@
+
ERROR: .../test-url.py output changed
!
Failed test-url.py: output changed
# Ran 1 tests, 0 skipped, 1 failed.
[ original upstream message ]
#!/usr/bin/env python
# $Id$
from distutils.core import setup
import os, time
# specify version, Mercurial version otherwise
version = ''
unknown_version = 'unknown'
def getversion():
global version, unknown_version
if not version and os.path.isdir('.hg'):
p = os.popen('hg --quiet identify 2> %s' % os.devnull)
ident = p.read()[:-1]
if not p.close() and ident:
if ident[-1] != '+':
version = ident
else:
version = ident[:-1]
version += time.strftime('+%Y%m%d')
return version or unknown_version
setup(name='hgkw',
version=getversion(),
description='Mercurial keyword extension (standalone)',
author='Christian Ebert',
author_email='blacktrash@gmx.net',
url='http://www.blacktrash.org/hg/hgkeyword/',
license='GNU GPL',
packages=['hgkw'])