tests/test-doctest.py
author Renato Cunha <renatoc@gmail.com>
Sat, 07 Aug 2010 16:38:38 -0300
changeset 11878 8bb1481cf08f
parent 11337 0f3c8a47960e
child 12165 b7fbf24c8a93
child 12594 bb324910e40a
permissions -rw-r--r--
py3kcompat: added fake ord implementation for py3k In py3k, a bytes object __getitem__ will return an int instead of a one-character bytes object. This has negative consequences when we want to ord(), like in the following example: >>> b'foo'[0] 102 >>> ord(b'foo'[0]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: ord() expected string of length 1, but int found This patch overrides the default ord() implementation to just return an int that's what is passed as an argument for ord(). Making the above call succeed: >>> ord(b'foo'[0]) 102
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7041
b856071435f7 tests: fix readline escape characters in output for test-doctest.py
Mads Kiilerich <mads@kiilerich.com>
parents: 5525
diff changeset
     1
# this is hack to make sure no escape characters are inserted into the output
10413
e433002acb05 fix up a bunch of check-code warnings
Matt Mackall <mpm@selenic.com>
parents: 7185
diff changeset
     2
import os
7078
967adcf5910d test-doctest: remove TERM env variable only if it's there
Patrick Mezard <pmezard@gmail.com>
parents: 7041
diff changeset
     3
if 'TERM' in os.environ:
7184
380fda3eed13 clean up trailing spaces
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 7078
diff changeset
     4
    del os.environ['TERM']
3232
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     5
import doctest
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     6
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     7
import mercurial.changelog
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     8
# test doctest from changelog
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     9
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    10
doctest.testmod(mercurial.changelog)
394ac87f3b74 [extendedchangelog] encode/decode function
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    11
5066
167c422c745f httprepo: quote the path part of the URL
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4122
diff changeset
    12
import mercurial.httprepo
167c422c745f httprepo: quote the path part of the URL
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4122
diff changeset
    13
doctest.testmod(mercurial.httprepo)
5525
dcbda0c4c3eb Do not display passwords with pull/push/incoming/outgoing
Manuel Holtgrewe <purestorm@ggnore.net>
parents: 5066
diff changeset
    14
dcbda0c4c3eb Do not display passwords with pull/push/incoming/outgoing
Manuel Holtgrewe <purestorm@ggnore.net>
parents: 5066
diff changeset
    15
import mercurial.util
dcbda0c4c3eb Do not display passwords with pull/push/incoming/outgoing
Manuel Holtgrewe <purestorm@ggnore.net>
parents: 5066
diff changeset
    16
doctest.testmod(mercurial.util)
7097
d4218edd55bd convert: fix builtin cvsps under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 7078
diff changeset
    17
11335
3201ff1459dd dagparser: parses and formats DAGs as concise text
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 10413
diff changeset
    18
import mercurial.dagparser
11337
0f3c8a47960e debugbuilddag: build a changelog dag from a concise description
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 11335
diff changeset
    19
doctest.testmod(mercurial.dagparser, optionflags=doctest.NORMALIZE_WHITESPACE)
11335
3201ff1459dd dagparser: parses and formats DAGs as concise text
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 10413
diff changeset
    20
7097
d4218edd55bd convert: fix builtin cvsps under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 7078
diff changeset
    21
import hgext.convert.cvsps
d4218edd55bd convert: fix builtin cvsps under Windows
Patrick Mezard <pmezard@gmail.com>
parents: 7078
diff changeset
    22
doctest.testmod(hgext.convert.cvsps)