/usr/lib/python2.6
NameSizeModeActions
bsddb/-0755rm
compiler/-0755rm
config/-0755rm
ctypes/-0755rm
curses/-0755rm
distutils/-0755rm
email/-0755rm
encodings/-0755rm
hotshot/-0755rm
idlelib/-0755rm
json/-0755rm
lib-dynload/-0755rm
lib2to3/-0755rm
logging/-0755rm
multiprocessing/-0755rm
plat-linux2/-0755rm
site-packages/-0755rm
sqlite3/-0755rm
test/-0755rm
wsgiref/-0755rm
xml/-0755rm
abc.py70340644editdlrm
abc.pyc60490644editdlrm
abc.pyo59910644editdlrm
aifc.py331880644editdlrm
aifc.pyc294240644editdlrm
aifc.pyo294240644editdlrm
anydbm.py26200644editdlrm
anydbm.pyc27690644editdlrm
anydbm.pyo27690644editdlrm
ast.py113470644editdlrm
ast.pyc127320644editdlrm
ast.pyo127320644editdlrm
asynchat.py114020644editdlrm
asynchat.pyc86770644editdlrm
asynchat.pyo86770644editdlrm
asyncore.py200610644editdlrm
asyncore.pyc183340644editdlrm
asyncore.pyo183340644editdlrm
atexit.py17050644editdlrm
atexit.pyc22030644editdlrm
atexit.pyo22030644editdlrm
audiodev.py75970644editdlrm
audiodev.pyc84830644editdlrm
audiodev.pyo84830644editdlrm
base64.py113350755editdlrm
base64.pyc109670644editdlrm
base64.pyo109670644editdlrm
BaseHTTPServer.py219740644editdlrm
BaseHTTPServer.pyc215350644editdlrm
BaseHTTPServer.pyo215350644editdlrm
Bastion.py57440644editdlrm
Bastion.pyc66370644editdlrm
Bastion.pyo66370644editdlrm
bdb.py205970644editdlrm
bdb.pyc184490644editdlrm
bdb.pyo184490644editdlrm
binhex.py148780644editdlrm
binhex.pyc157730644editdlrm
binhex.pyo157730644editdlrm
bisect.py26620644editdlrm
bisect.pyc31630644editdlrm
bisect.pyo31630644editdlrm
calendar.py231100644editdlrm
calendar.pyc280070644editdlrm
calendar.pyo280070644editdlrm
cgi.py344780755editdlrm
cgi.pyc326800644editdlrm
cgi.pyo326800644editdlrm
CGIHTTPServer.py127730644editdlrm
CGIHTTPServer.pyc107940644editdlrm
CGIHTTPServer.pyo107940644editdlrm
cgitb.py121550644editdlrm
cgitb.pyc124250644editdlrm
cgitb.pyo124250644editdlrm
chunk.py53720644editdlrm
chunk.pyc56230644editdlrm
chunk.pyo56230644editdlrm
cmd.py149620644editdlrm
cmd.pyc139140644editdlrm
cmd.pyo139140644editdlrm
code.py102170644editdlrm
code.pyc103950644editdlrm
code.pyo103950644editdlrm
codecs.py352660644editdlrm
codecs.pyc365330644editdlrm
codecs.pyo365330644editdlrm
codeop.py59990644editdlrm
codeop.pyc66160644editdlrm
codeop.pyo66160644editdlrm
collections.py137300644editdlrm
collections.pyc143920644editdlrm
collections.pyo143390644editdlrm
colorsys.py34590644editdlrm
colorsys.pyc40250644editdlrm
colorsys.pyo40250644editdlrm
commands.py25430644editdlrm
commands.pyc24770644editdlrm
commands.pyo24770644editdlrm
compileall.py52850644editdlrm
compileall.pyc49890644editdlrm
compileall.pyo49890644editdlrm
ConfigParser.py259890644editdlrm
ConfigParser.pyc237550644editdlrm
ConfigParser.pyo237550644editdlrm
contextlib.py41360644editdlrm
contextlib.pyc41270644editdlrm
contextlib.pyo41270644editdlrm
Cookie.py250540644editdlrm
Cookie.pyc220670644editdlrm
Cookie.pyo220670644editdlrm
cookielib.py647260644editdlrm
cookielib.pyc551760644editdlrm
cookielib.pyo549850644editdlrm
copy.py111770644editdlrm
copy.pyc116290644editdlrm
copy.pyo115330644editdlrm
copy_reg.py68000644editdlrm
copy_reg.pyc51560644editdlrm
copy_reg.pyo51100644editdlrm
cProfile.py63370755editdlrm
cProfile.pyc62110644editdlrm
cProfile.pyo62110644editdlrm
crypt.py22290644editdlrm
crypt.pyc30430644editdlrm
crypt.pyo30430644editdlrm
csv.py157300644editdlrm
csv.pyc131700644editdlrm
csv.pyo131700644editdlrm
dbhash.py5350644editdlrm
dbhash.pyc7560644editdlrm
dbhash.pyo7560644editdlrm
decimal.py1992730644editdlrm
decimal.pyc1551850644editdlrm
decimal.pyo1551190644editdlrm
difflib.py810800644editdlrm
difflib.pyc610930644editdlrm
difflib.pyo610390644editdlrm
dircache.py11260644editdlrm
dircache.pyc15760644editdlrm
dircache.pyo15760644editdlrm
dis.py64490644editdlrm
dis.pyc63500644editdlrm
dis.pyo63500644editdlrm
doctest.py1015160644editdlrm
doctest.pyc807820644editdlrm
doctest.pyo804940644editdlrm
DocXMLRPCServer.py105990644editdlrm
DocXMLRPCServer.pyc99210644editdlrm
DocXMLRPCServer.pyo98130644editdlrm
dumbdbm.py88200644editdlrm
dumbdbm.pyc65470644editdlrm
dumbdbm.pyo65470644editdlrm
dummy_thread.py44180644editdlrm
dummy_thread.pyc53830644editdlrm
dummy_thread.pyo53830644editdlrm
dummy_threading.py28040644editdlrm
dummy_threading.pyc12950644editdlrm
dummy_threading.pyo12950644editdlrm
filecmp.py94700644editdlrm
filecmp.pyc95920644editdlrm
filecmp.pyo95920644editdlrm
fileinput.py141430644editdlrm
fileinput.pyc148700644editdlrm
fileinput.pyo148700644editdlrm
fnmatch.py32390644editdlrm
fnmatch.pyc35670644editdlrm
fnmatch.pyo35670644editdlrm
formatter.py149110644editdlrm
formatter.pyc191490644editdlrm
formatter.pyo191490644editdlrm
fpformat.py46990644editdlrm
fpformat.pyc47190644editdlrm
fpformat.pyo47190644editdlrm
fractions.py200730644editdlrm
fractions.pyc180410644editdlrm
fractions.pyo180410644editdlrm
ftplib.py291970644editdlrm
ftplib.pyc283870644editdlrm
ftplib.pyo283870644editdlrm
functools.py21620644editdlrm
functools.pyc19210644editdlrm
functools.pyo19210644editdlrm
genericpath.py30200644editdlrm
genericpath.pyc32720644editdlrm
genericpath.pyo32720644editdlrm
getopt.py73280644editdlrm
getopt.pyc67100644editdlrm
getopt.pyo66630644editdlrm
getpass.py55340644editdlrm
getpass.pyc47400644editdlrm
getpass.pyo47400644editdlrm
gettext.py199680644editdlrm
gettext.pyc156740644editdlrm
gettext.pyo156740644editdlrm
glob.py22490644editdlrm
glob.pyc23950644editdlrm
glob.pyo23950644editdlrm
gzip.py167540644editdlrm
gzip.pyc143220644editdlrm
gzip.pyo143220644editdlrm
hashlib.py44270644editdlrm
hashlib.pyc39750644editdlrm
hashlib.pyo39750644editdlrm
heapq.py159950644editdlrm
heapq.pyc126680644editdlrm
heapq.pyo126680644editdlrm
hmac.py45310644editdlrm
hmac.pyc44890644editdlrm
hmac.pyo44890644editdlrm
htmlentitydefs.py180540644editdlrm
htmlentitydefs.pyc63690644editdlrm
htmlentitydefs.pyo63690644editdlrm
htmllib.py128690644editdlrm
htmllib.pyc202020644editdlrm
htmllib.pyo202020644editdlrm
HTMLParser.py135760644editdlrm
HTMLParser.pyc121980644editdlrm
HTMLParser.pyo118900644editdlrm
httplib.py487970644editdlrm
httplib.pyc375780644editdlrm
httplib.pyo373820644editdlrm
ihooks.py174520644editdlrm
ihooks.pyc206990644editdlrm
ihooks.pyo206200644editdlrm
imaplib.py477710644editdlrm
imaplib.pyc450270644editdlrm
imaplib.pyo422870644editdlrm
imghdr.py35440644editdlrm
imghdr.pyc48730644editdlrm
imghdr.pyo48730644editdlrm
imputil.py260090644editdlrm
imputil.pyc159590644editdlrm
imputil.pyo157870644editdlrm
inspect.py381890644editdlrm
inspect.pyc370330644editdlrm
inspect.pyo370330644editdlrm
io.py661650644editdlrm
io.pyc627120644editdlrm
io.pyo627120644editdlrm
keyword.py19970755editdlrm
keyword.pyc21130644editdlrm
keyword.pyo21130644editdlrm
linecache.py41280644editdlrm
linecache.pyc32560644editdlrm
linecache.pyo32560644editdlrm
locale.py826740644editdlrm
locale.pyc466200644editdlrm
locale.pyo466200644editdlrm
macpath.py62530644editdlrm
macpath.pyc76690644editdlrm
macpath.pyo76690644editdlrm
macurl2path.py32750644editdlrm
macurl2path.pyc28150644editdlrm
macurl2path.pyo28150644editdlrm
mailbox.py758240644editdlrm
mailbox.pyc756330644editdlrm
mailbox.pyo755840644editdlrm
mailcap.py84020644editdlrm
mailcap.pyc80510644editdlrm
mailcap.pyo80510644editdlrm
markupbase.py143500644editdlrm
markupbase.pyc94300644editdlrm
markupbase.pyo92360644editdlrm
md5.py4100644editdlrm
md5.pyc3760644editdlrm
md5.pyo3760644editdlrm
mhlib.py334340644editdlrm
mhlib.pyc339810644editdlrm
mhlib.pyo339810644editdlrm
mimetools.py71680644editdlrm
mimetools.pyc82800644editdlrm
mimetools.pyo82800644editdlrm
mimetypes.py188220644editdlrm
mimetypes.pyc168380644editdlrm
mimetypes.pyo168380644editdlrm
MimeWriter.py64820644editdlrm
MimeWriter.pyc73650644editdlrm
MimeWriter.pyo73650644editdlrm
mimify.py150240755editdlrm
mimify.pyc121890644editdlrm
mimify.pyo121890644editdlrm
modulefinder.py242830644editdlrm
modulefinder.pyc189390644editdlrm
modulefinder.pyo188510644editdlrm
multifile.py48200644editdlrm
multifile.pyc54490644editdlrm
multifile.pyo54050644editdlrm
mutex.py18660644editdlrm
mutex.pyc25120644editdlrm
mutex.pyo25120644editdlrm
netrc.py41110644editdlrm
netrc.pyc35860644editdlrm
netrc.pyo35860644editdlrm
new.py7060644editdlrm
new.pyc9080644editdlrm
new.pyo9080644editdlrm
nntplib.py214700644editdlrm
nntplib.pyc210910644editdlrm
nntplib.pyo210910644editdlrm
ntpath.py177520644editdlrm
ntpath.pyc115820644editdlrm
ntpath.pyo115350644editdlrm
nturl2path.py22390644editdlrm
nturl2path.pyc17710644editdlrm
nturl2path.pyo17710644editdlrm
numbers.py102710644editdlrm
numbers.pyc138400644editdlrm
numbers.pyo138400644editdlrm
opcode.py52480644editdlrm
opcode.pyc59070644editdlrm
opcode.pyo59070644editdlrm
optparse.py608490644editdlrm
optparse.pyc539590644editdlrm
optparse.pyo538770644editdlrm
ordereddict.py360644editdlrm
ordereddict.pyc1830644editdlrm
ordereddict.pyo1830644editdlrm
os.py258020644editdlrm
os.pyc257020644editdlrm
os.pyo257020644editdlrm
os2emxpath.py46030644editdlrm
os2emxpath.pyc45180644editdlrm
os2emxpath.pyo45180644editdlrm
pdb.doc78990644editdlrm
pdb.py453330755editdlrm
pdb.pyc435850644editdlrm
pdb.pyo435850644editdlrm
pickle.py448110644editdlrm
pickle.pyc384370644editdlrm
pickle.pyo382320644editdlrm
pickletools.py743480644editdlrm
pickletools.pyc570790644editdlrm
pickletools.pyo561820644editdlrm
pipes.py96470644editdlrm
pipes.pyc94280644editdlrm
pipes.pyo94280644editdlrm
pkgutil.py200010644editdlrm
pkgutil.pyc189540644editdlrm
pkgutil.pyo189540644editdlrm
platform.py526300755editdlrm
platform.pyc386990644editdlrm
platform.pyo386990644editdlrm
plistlib.py158060644editdlrm
plistlib.pyc199260644editdlrm
plistlib.pyo198360644editdlrm
popen2.py84160644editdlrm
popen2.pyc90320644editdlrm
popen2.pyo89880644editdlrm
poplib.py128250644editdlrm
poplib.pyc133520644editdlrm
poplib.pyo133520644editdlrm
posixfile.py80030644editdlrm
posixfile.pyc77000644editdlrm
posixfile.pyo77000644editdlrm
posixpath.py131190644editdlrm
posixpath.pyc111420644editdlrm
posixpath.pyo111420644editdlrm
pprint.py119320644editdlrm
pprint.pyc103560644editdlrm
pprint.pyo101810644editdlrm
profile.py235100755editdlrm
profile.pyc166000644editdlrm
profile.pyo163550644editdlrm
pstats.py273100644editdlrm
pstats.pyc252120644editdlrm
pstats.pyo252120644editdlrm
pty.py48690644editdlrm
pty.pyc48990644editdlrm
pty.pyo48990644editdlrm
pyclbr.py132820644editdlrm
pyclbr.pyc97060644editdlrm
pyclbr.pyo97060644editdlrm
pydoc.py924320755editdlrm
pydoc.pyc906620644editdlrm
pydoc.pyo905940644editdlrm
pydoc_topics.py4231260644editdlrm
pydoc_topics.pyc4075860644editdlrm
pydoc_topics.pyo4075860644editdlrm
py_compile.py56330644editdlrm
py_compile.pyc65360644editdlrm
py_compile.pyo65360644editdlrm
Queue.py85740644editdlrm
Queue.pyc93910644editdlrm
Queue.pyo93910644editdlrm
quopri.py69720755editdlrm
quopri.pyc66660644editdlrm
quopri.pyo66660644editdlrm
random.py319660644editdlrm
random.pyc250240644editdlrm
random.pyo250240644editdlrm
re.py129660644editdlrm
re.pyc131220644editdlrm
re.pyo131220644editdlrm
repr.py42960644editdlrm
repr.pyc54000644editdlrm
repr.pyo54000644editdlrm
rexec.py201520644editdlrm
rexec.pyc241020644editdlrm
rexec.pyo241020644editdlrm
rfc822.py332950644editdlrm
rfc822.pyc319900644editdlrm
rfc822.pyo319900644editdlrm
rlcompleter.py58660644editdlrm
rlcompleter.pyc60570644editdlrm
rlcompleter.pyo60570644editdlrm
robotparser.py70140644editdlrm
robotparser.pyc78040644editdlrm
robotparser.pyo78040644editdlrm
runpy.py54130644editdlrm
runpy.pyc39650644editdlrm
runpy.pyo39650644editdlrm
sched.py50910644editdlrm
sched.pyc49870644editdlrm
sched.pyo49870644editdlrm
sets.py190500644editdlrm
sets.pyc168850644editdlrm
sets.pyo168850644editdlrm
sgmllib.py178840644editdlrm
sgmllib.pyc155040644editdlrm
sgmllib.pyo155040644editdlrm
sha.py4450644editdlrm
sha.pyc4190644editdlrm
sha.pyo4190644editdlrm
shelve.py80780644editdlrm
shelve.pyc102420644editdlrm
shelve.pyo102420644editdlrm
shlex.py111370644editdlrm
shlex.pyc76840644editdlrm
shlex.pyo76840644editdlrm
shutil.py86320644editdlrm
shutil.pyc95190644editdlrm
shutil.pyo95190644editdlrm
SimpleHTTPServer.py74220644editdlrm
SimpleHTTPServer.pyc77440644editdlrm
SimpleHTTPServer.pyo77440644editdlrm
SimpleXMLRPCServer.py219920644editdlrm
SimpleXMLRPCServer.pyc195750644editdlrm
SimpleXMLRPCServer.pyo195750644editdlrm
site.py189270644editdlrm
site.pyc186630644editdlrm
site.pyo186630644editdlrm
smtpd.py189200755editdlrm
smtpd.pyc161260644editdlrm
smtpd.pyo161260644editdlrm
smtplib.py309240755editdlrm
smtplib.pyc296290644editdlrm
smtplib.pyo296290644editdlrm
sndhdr.py59730644editdlrm
sndhdr.pyc73860644editdlrm
sndhdr.pyo73860644editdlrm
socket.py201490644editdlrm
socket.pyc160670644editdlrm
socket.pyo159820644editdlrm
SocketServer.py223260644editdlrm
SocketServer.pyc230350644editdlrm
SocketServer.pyo230350644editdlrm
sre.py3840644editdlrm
sre.pyc5170644editdlrm
sre.pyo5170644editdlrm
sre_compile.py165070644editdlrm
sre_compile.pyc114550644editdlrm
sre_compile.pyo113420644editdlrm
sre_constants.py71370644editdlrm
sre_constants.pyc60830644editdlrm
sre_constants.pyo60830644editdlrm
sre_parse.py268780644editdlrm
sre_parse.pyc196220644editdlrm
sre_parse.pyo196220644editdlrm
ssl.py166770644editdlrm
ssl.pyc142180644editdlrm
ssl.pyo142180644editdlrm
stat.py17180644editdlrm
stat.pyc26830644editdlrm
stat.pyo26830644editdlrm
statvfs.py8980644editdlrm
statvfs.pyc6180644editdlrm
statvfs.pyo6180644editdlrm
string.py207450644editdlrm
string.pyc199640644editdlrm
string.pyo199640644editdlrm
StringIO.py106210644editdlrm
StringIO.pyc114940644editdlrm
StringIO.pyo114940644editdlrm
stringold.py124490644editdlrm
stringold.pyc125390644editdlrm
stringold.pyo125390644editdlrm
stringprep.py135220644editdlrm
stringprep.pyc144860644editdlrm
stringprep.pyo144120644editdlrm
struct.py820644editdlrm
struct.pyc2370644editdlrm
struct.pyo2370644editdlrm
subprocess.py579450644editdlrm
subprocess.pyc409750644editdlrm
subprocess.pyo409180644editdlrm
sunau.py165370644editdlrm
sunau.pyc179760644editdlrm
sunau.pyo179760644editdlrm
sunaudio.py13990644editdlrm
sunaudio.pyc19870644editdlrm
sunaudio.pyo19870644editdlrm
symbol.py20500755editdlrm
symbol.pyc30210644editdlrm
symbol.pyo30210644editdlrm
symtable.py79110644editdlrm
symtable.pyc125030644editdlrm
symtable.pyo123730644editdlrm
tabnanny.py113390755editdlrm
tabnanny.pyc82930644editdlrm
tabnanny.pyo82930644editdlrm
tarfile.py877860644editdlrm
tarfile.pyc735960644editdlrm
tarfile.pyo735960644editdlrm
telnetlib.py218080644editdlrm
telnetlib.pyc198550644editdlrm
telnetlib.pyo198550644editdlrm
tempfile.py177740644editdlrm
tempfile.pyc194630644editdlrm
tempfile.pyo194630644editdlrm
textwrap.py168890644editdlrm
textwrap.pyc117660644editdlrm
textwrap.pyo116740644editdlrm
this.py10020644editdlrm
this.pyc12390644editdlrm
this.pyo12390644editdlrm
threading.py318080644editdlrm
threading.pyc279560644editdlrm
threading.pyo258840644editdlrm
timeit.py120030644editdlrm
timeit.pyc118010644editdlrm
timeit.pyo118010644editdlrm
toaiff.py31420644editdlrm
toaiff.pyc31260644editdlrm
toaiff.pyo31260644editdlrm
token.py29470755editdlrm
token.pyc38300644editdlrm
token.pyo38300644editdlrm
tokenize.py163260644editdlrm
tokenize.pyc139860644editdlrm
tokenize.pyo138930644editdlrm
trace.py303250644editdlrm
trace.pyc229890644editdlrm
trace.pyo229270644editdlrm
traceback.py112110644editdlrm
traceback.pyc116370644editdlrm
traceback.pyo116370644editdlrm
tty.py8790644editdlrm
tty.pyc13110644editdlrm
tty.pyo13110644editdlrm
types.py23230644editdlrm
types.pyc26080644editdlrm
types.pyo26080644editdlrm
unittest.py311570644editdlrm
unittest.pyc346560644editdlrm
unittest.pyo346560644editdlrm
urllib.py590220644editdlrm
urllib.pyc511420644editdlrm
urllib.pyo510480644editdlrm
urllib2.py508660644editdlrm
urllib2.pyc455690644editdlrm
urllib2.pyo454750644editdlrm
urlparse.py156180644editdlrm
urlparse.pyc147270644editdlrm
urlparse.pyo147270644editdlrm
user.py16270644editdlrm
user.pyc17340644editdlrm
user.pyo17340644editdlrm
UserDict.py57780644editdlrm
UserDict.pyc88020644editdlrm
UserDict.pyo88020644editdlrm
UserList.py36440644editdlrm
UserList.pyc65350644editdlrm
UserList.pyo65350644editdlrm
UserString.py96910755editdlrm
UserString.pyc147860644editdlrm
UserString.pyo147860644editdlrm
uu.py59420755editdlrm
uu.pyc42270644editdlrm
uu.pyo42270644editdlrm
uuid.py209440644editdlrm
uuid.pyc212050644editdlrm
uuid.pyo212050644editdlrm
warnings.py141720644editdlrm
warnings.pyc129960644editdlrm
warnings.pyo121590644editdlrm
wave.py179520644editdlrm
wave.pyc193360644editdlrm
wave.pyo193360644editdlrm
weakref.py100870644editdlrm
weakref.pyc132770644editdlrm
weakref.pyo132770644editdlrm
webbrowser.py210730644editdlrm
webbrowser.pyc186690644editdlrm
webbrowser.pyo186220644editdlrm
whichdb.py33530644editdlrm
whichdb.pyc22430644editdlrm
whichdb.pyo22430644editdlrm
xdrlib.py55130644editdlrm
xdrlib.pyc90790644editdlrm
xdrlib.pyo90790644editdlrm
xmllib.py348650644editdlrm
xmllib.pyc271660644editdlrm
xmllib.pyo271660644editdlrm
xmlrpclib.py477750644editdlrm
xmlrpclib.pyc412300644editdlrm
xmlrpclib.pyo410470644editdlrm
zipfile.py530920644editdlrm
zipfile.pyc375470644editdlrm
zipfile.pyo375470644editdlrm
_abcoll.py142420644editdlrm
_abcoll.pyc213950644editdlrm
_abcoll.pyo213950644editdlrm
_LWPCookieJar.py65530644editdlrm
_LWPCookieJar.pyc55890644editdlrm
_LWPCookieJar.pyo55890644editdlrm
_MozillaCookieJar.py58090644editdlrm
_MozillaCookieJar.pyc45090644editdlrm
_MozillaCookieJar.pyo44680644editdlrm
_strptime.py197540644editdlrm
_strptime.pyc149260644editdlrm
_strptime.pyo149260644editdlrm
_threading_local.py71140644editdlrm
_threading_local.pyc63670644editdlrm
_threading_local.pyo63670644editdlrm
__future__.py43800644editdlrm
__future__.pyc42210644editdlrm
__future__.pyo42210644editdlrm
__phello__.foo.py640644editdlrm
__phello__.foo.pyc1230644editdlrm
__phello__.foo.pyo1230644editdlrm
Edit: /usr/lib/python2.6/doctest.pyo (80494B)
gc!@sdZdZdddddddd d d d d ddddddddddddddddddd d!d"g!Zd#d$kZd#d$kZd#d$kZd#d$kZd#d$kZd#d$kZd#d$k Z d#d$k Z d#d$k Z d#d$k Z d#d$k Z d#d$kZd#d%klZd#d&klZed'd(ZhZd)ZedZedZedZedZedZedZeeBeBeBeBeBZed Zed Zed Zed ZeeBeBeBZ d*Z!d+Z"d,Z#d-d.Z$d/Z%e&ei'd0e(pd1Z)d2d3Z*d4Z+d5efd6YZ,d7Z-d8Z.d9e i/fd:YZ0d;Z1dfd<YZ2dfd=YZ3dfd>YZ4dfd?YZ5dfd@YZ6dfdAYZ7de8fdBYZ9de8fdCYZ:de6fdDYZ;e(a<e(e(e(e(e=dEe(e>e>dF Z?e=e(e(e(e(e=dEe(e>e4e(dG Z@e>dHe(dEdIZAdfdJYZBdEaCdKZDdLe iEfdMYZFe(e(e(e(dNZGdOeFfdPYZHe=e(e(e4e(dQZIdRZJdSZKdTZLe>e(dUZMe>e(dVZNe>dWZOdXfdYYZPhePdX6dZd[6d\d]6d^d_6d`da6dbdc6ZQddZReSdejoeiTeRnd$S(fsModule doctest -- a framework for running examples in docstrings. In simplest use, end each module M to be tested with: def _test(): import doctest doctest.testmod() if __name__ == "__main__": _test() Then running the module as a script will cause the examples in the docstrings to get executed and verified: python M.py This won't display anything unless an example fails, in which case the failing example(s) and the cause(s) of the failure(s) are printed to stdout (why not stderr? because stderr is a lame hack <0.2 wink>), and the final line of output is "Test failed.". Run it with the -v switch instead: python M.py -v and a detailed report of all examples tried is printed to stdout, along with assorted summaries at the end. You can force verbose mode by passing "verbose=True" to testmod, or prohibit it by passing "verbose=False". In either of those cases, sys.argv is not examined by testmod. There are a variety of other ways to run doctests, including integration with the unittest framework, and support for running non-Python text files containing doctests. There are also many ways to override parts of doctest's default behaviors. See the Library Reference Manual for details. sreStructuredText entregister_optionflagtDONT_ACCEPT_TRUE_FOR_1tDONT_ACCEPT_BLANKLINEtNORMALIZE_WHITESPACEtELLIPSIStSKIPtIGNORE_EXCEPTION_DETAILtCOMPARISON_FLAGSt REPORT_UDIFFt REPORT_CDIFFt REPORT_NDIFFtREPORT_ONLY_FIRST_FAILUREtREPORTING_FLAGStExampletDocTestt DocTestParsert DocTestFindert DocTestRunnert OutputCheckertDocTestFailuretUnexpectedExceptiont DebugRunnerttestmodttestfiletrun_docstring_examplestTestert DocTestSuitet DocFileSuitetset_unittest_reportflagstscript_from_examplest testsourcet debug_srctdebugiN(tStringIO(t namedtuplet TestResultssfailed attemptedcCsti|dtt>S(Ni(tOPTIONFLAGS_BY_NAMEt setdefaulttlen(tname((s/usr/lib/python2.6/doctest.pyRss s...cCsWd}xJtiD]?}|i|d}|tt|jo||iO}qqW|S(s Return the compiler-flags associated with the future features that have been imported into the given namespace (globs). iN(t __future__tall_feature_namestgettNonetgetattrt compiler_flag(tglobstflagstfnametfeature((s/usr/lib/python2.6/doctest.pyt_extract_future_flagss icCsti|o|St|ttfot|ttdgS|djot i t i |i dSt ddS(s Return the module specified by `module`. In particular: - If `module` is a module, then return module. - If `module` is a string, then import and return the module with that name. - If `module` is None, then return the calling module. The calling module is assumed to be the module of the stack frame at the given depth in the call stack. t*t__name__s"Expected a module, string, or NoneN(tinspecttismodulet isinstancetstrtunicodet __import__tglobalstlocalsR+tsystmodulest _getframet f_globalst TypeError(tmoduletdepth((s/usr/lib/python2.6/doctest.pyt_normalize_modules  cCs|out|d}t||}t|doCt|ido,|ii|}|itid|fSq|nt|i |fS(Nit __loader__tget_datas ( RDt_module_relative_paththasattrRERFtreplacetostlineseptopentread(tfilenametpackagetmodule_relativet file_contents((s/usr/lib/python2.6/doctest.pyt_load_testfiles"tencodingsutf-8icCs=t|to|itd}ntid|d|S(s Add the given number of space characters to the beginning of every non-blank line in `s`, and return the result. If the string `s` is Unicode, it is encoded using the stdout encoding and the `backslashreplace` error handler. tbackslashreplaces (?m)^(?!$)t (R7R9tencodet _encodingtretsub(tstindent((s/usr/lib/python2.6/doctest.pyt_indentscCs;t}|\}}}ti|||d||iS(sz Return a string containing a traceback message for the given exc_info tuple (as returned by sys.exc_info()). tfile(R!t tracebacktprint_exceptiontgetvalue(texc_infotexcouttexc_typetexc_valtexc_tb((s/usr/lib/python2.6/doctest.pyt_exception_tracebacks t _SpoofOutcBseZdZddZRS(cCsSti|}|o|id o|d7}nt|do |`n|S(Ns t softspace(R!R`tendswithRHRh(tselftresult((s/usr/lib/python2.6/doctest.pyR`s  cCsEti||t|do |`n|ip d|_ndS(NRht(R!ttruncateRHRhtbuf(Rjtsize((s/usr/lib/python2.6/doctest.pyRms   N(R4t __module__R`R+Rm(((s/usr/lib/python2.6/doctest.pyRgs cCst|jo ||jS|it}dt|}}|d}|o/|i|ot|}|d=qztSn|d}|o3|i|o|t|8}|d=qtSn||jotSxE|D]=}|i|||}|djotS|t|7}qWtS(s_ Essentially the only subtle case: >>> _ellipsis_match('aa...aa', 'aaa') False ii(tELLIPSIS_MARKERtsplitR&t startswithtFalseRitfindtTrue(twanttgottwststartpostendpostw((s/usr/lib/python2.6/doctest.pyt_ellipsis_matchs2         cCs$|i}|o d|SdSdS(s)Return a commented form of the given lines# t#N(trstrip(tline((s/usr/lib/python2.6/doctest.pyt _comment_line@s  t_OutputRedirectingPdbcBs5eZdZdZddZdZdZRS(s A specialized version of the python debugger that redirects stdout to a given stream when interacting with the user. Stdout is *not* redirected when traced code is executed. cCs5||_t|_tii|d|d|_dS(Ntstdouti(t_OutputRedirectingPdb__outRtt$_OutputRedirectingPdb__debugger_usedtpdbtPdbt__init__t use_rawinput(Rjtout((s/usr/lib/python2.6/doctest.pyRNs  cCs@t|_|djotii}ntii||dS(N( RvRR+R=R?tf_backRRt set_trace(Rjtframe((s/usr/lib/python2.6/doctest.pyRUs  cCs"|iotii|ndS(N(RRRt set_continue(Rj((s/usr/lib/python2.6/doctest.pyR[s cGs=ti}|it_ztii||SWd|t_XdS(N(R=RRRRttrace_dispatch(Rjtargst save_stdout((s/usr/lib/python2.6/doctest.pyRas   N(R4Rpt__doc__RR+RRR(((s/usr/lib/python2.6/doctest.pyRHs    cCsti|ptd|n|ido tdnt|dotii|i d}n}|i djoXt t i djo5t i ddjo!tiit i dd}qti}ntd|d tii||idS( NsExpected a module: %rt/s1Module-relative files may not have absolute pathst__file__it__main__Rls+Can't resolve paths relative to the module s (it has no __file__)(R5R6RARst ValueErrorRHRJtpathRrRR4R&R=targvtcurdirtjoin(RBRtbasedir((s/usr/lib/python2.6/doctest.pyRGls *! cBs#eZdZdddddZRS(sn A single doctest example, consisting of source code and expected output. `Example` defines the following attributes: - source: A single Python statement, always ending with a newline. The constructor adds a newline if needed. - want: The expected output from running the source code (either from stdout, or a traceback in case of exception). `want` ends with a newline unless it's empty, in which case it's an empty string. The constructor adds a newline if needed. - exc_msg: The exception message generated by the example, if the example is expected to generate an exception; or `None` if it is not expected to generate an exception. This exception message is compared against the return value of `traceback.format_exception_only()`. `exc_msg` ends with a newline unless it's `None`. The constructor adds a newline if needed. - lineno: The line number within the DocTest string containing this Example where the Example begins. This line number is zero-based, with respect to the beginning of the DocTest. - indent: The example's indentation in the DocTest string. I.e., the number of space characters that preceed the example's first prompt. - options: A dictionary mapping from option flags to True or False, which is used to override default options for this example. Any option flags not contained in this dictionary are left at their default value (as specified by the DocTestRunner's optionflags). By default, no options are set. icCs|idp|d7}n|o|id o|d7}n|dj o|id o|d7}n||_||_||_||_|djo h}n||_||_dS(Ns (RiR+tsourceRwtlinenoR[toptionstexc_msg(RjRRwRRR[R((s/usr/lib/python2.6/doctest.pyRs      N(R4RpRR+R(((s/usr/lib/python2.6/doctest.pyR s" cBs)eZdZdZdZdZRS(se A collection of doctest examples that should be run in a single namespace. Each `DocTest` defines the following attributes: - examples: the list of examples. - globs: The namespace (aka globals) that the examples should be run in. - name: A name identifying the DocTest (typically, the name of the object whose docstring this DocTest was extracted from). - filename: The name of the file that this DocTest was extracted from, or `None` if the filename is unknown. - lineno: The line number within filename where this DocTest begins, or `None` if the line number is unavailable. This line number is zero-based, with respect to the beginning of the file. - docstring: The string that the examples were extracted from, or `None` if the string is unavailable. cCs@||_||_|i|_||_||_||_dS(s Create a new DocTest containing the given examples. The DocTest's globals are initialized with a copy of `globs`. N(texamplest docstringtcopyR.R'RNR(RjRR.R'RNRR((s/usr/lib/python2.6/doctest.pyRs     cCspt|idjo d}n4t|idjo d}ndt|i}d|i|i|i|fS(Nis no examplesis 1 examples %d exampless(R&RR'RNR(RjR((s/usr/lib/python2.6/doctest.pyt__repr__s  cCsXt|tpdSt|i|i|it|f|i|i|it|fS(Ni(R7RtcmpR'RNRtid(Rjtother((s/usr/lib/python2.6/doctest.pyt__cmp__s!(R4RpRRRR(((s/usr/lib/python2.6/doctest.pyRs  cBseZdZeideieiBZeideieiBeiBZ eidi Z ddZ dZ ddZdZeid eiZd Zeid eiZd Zd ZdZRS(sD A class used to parse strings containing doctest examples. s # Source consists of a PS1 line followed by zero or more PS2 lines. (?P (?:^(?P [ ]*) >>> .*) # PS1 line (?:\n [ ]* \.\.\. .*)*) # PS2 lines \n? # Want consists of any non-blank lines that do not start with PS1. (?P (?:(?![ ]*$) # Not a blank line (?![ ]*>>>) # Not a line starting with PS1 .*$\n? # But any other line )*) s # Grab the traceback header. Different versions of Python have # said different things on the first traceback line. ^(?P Traceback\ \( (?: most\ recent\ call\ last | innermost\ last ) \) : ) \s* $ # toss trailing whitespace on the header. (?P .*?) # don't blink: absorb stuff until... ^ (?P \w+ .*) # a line *starts* with alphanum. s ^[ ]*(#.*)?$scCs|i}|i|}|djo;dig}|idD]}|||qB~}ng}d\}}x|ii|D]} |i||| i!||id|| i7}|i | ||\} } } } |i | pB|it | | | d|d|t | i dd| n||id| i| i7}| i}qW|i|||S(s= Divide the given string into examples and intervening text, and return them as a list of alternating Examples and strings. Line numbers for the Examples are 0-based. The optional argument `name` is a name identifying this string, and is only used for error messages. is RR[R(ii(t expandtabst _min_indentRRrt _EXAMPLE_REtfinditertappendtstarttcountt_parse_examplet_IS_BLANK_OR_COMMENTR R&tgrouptend(RjtstringR't min_indentt_[1]tltoutputtcharnoRtmRRRwR((s/usr/lib/python2.6/doctest.pytparse1s(  ; !%cCs%t|i|||||||S(s" Extract all doctest examples from the given string, and collect them into a `DocTest` object. `globs`, `name`, `filename`, and `lineno` are attributes for the new `DocTest` object. See the documentation for `DocTest` for more information. (Rt get_examples(RjRR.R'RNR((s/usr/lib/python2.6/doctest.pyt get_doctestXs cCs?g}|i||D]!}t|to ||qq~S(s Extract all doctest examples from the given string, and return them as a list of `Example` objects. Line numbers are 0-based, because it's most common in doctests that nothing interesting appears on the same line as opening triple-quote, and so the first interesting line is called "line 1" then. The optional argument `name` is a name identifying this string, and is only used for error messages. (RR7R (RjRR'Rtx((s/usr/lib/python2.6/doctest.pyRds c Cst|id}|idid}|i|||||i|dd|d||dig}|D]}|||dqv~}|id} | id} t| djo"tid | d o | d =n|i| d|||t|dig} | D]} | | |q~ } |ii| }|o|id } nd } |i |||}||| | fS( s Given a regular expression match from `_EXAMPLE_RE` (`m`), return a pair `(source, want)`, where `source` is the matched example's source code (with prompts and indentation stripped); and `want` is the example's expected output (with indentation stripped). `name` is the string's name, and `lineno` is the line number where the example starts; both are used for error messages. R[Rs iRUt.iRws *$itmsgN( R&RRrt_check_prompt_blankt _check_prefixRRXtmatcht _EXCEPTION_RER+t _find_options(RjRR'RR[t source_linesRtslRRwt want_linest_[2]twlRR((s/usr/lib/python2.6/doctest.pyRrs$ "2* .s#\s*doctest:\s*([^\n\'"]*)$c Csh}x|ii|D]}|ididdi}xs|D]k}|ddjp|dtjo!td|d||fnt|d}|ddj||$              cCs|djotSti|dj o|ti|jSti|o|i|ijSti|o|i|i jSt |do|i|i jSt |t otSt ddS(sY Return true if the given object is defined in the given module. Rps"object must be a class or functionN(R+RvR5Rt isfunctionRt func_globalstisclassR4RpRHR7tpropertyR(RjRBtobject((s/usr/lib/python2.6/doctest.pyt _from_modulehs c Cs-|io d|GHnt||jodSd|t|<|i|||||}|dj o|i|nti|o|iox|ii D]r\} } d|| f} ti | pti | o6|i || o#|i || | ||||qqWnti|o|ioxt|dhi D]\} } t| tptdt| fnti | p=ti | p-ti| pti| p t| tptdt| fnd|| f} |i || | ||||qOWnti |o|iox|ii D]\} } t| tot|| } nt| tot|| i} nti | p ti | pt| toF|i || o3d|| f} |i || | ||||qVqVWndS( sm Find tests for the given object and any contained objects, and add them to `tests`. sFinding tests in %sNis%s.%st__test__s5DocTestFinder.find: __test__ keys must be strings: %rs`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rs%s.__test__.%s(RRt _get_testR+RR5R6RRtitemsRRRRR,R7t basestringRRtismethodt staticmethodt classmethodtim_funcR( RjRRR'RBRR.tseenttesttvalnametval((s/usr/lib/python2.6/doctest.pyR|sV          c Cst|to |}njyG|idjo d}n*|i}t|tpt|}nWnttfj o d}nX|i||}|io | odS|djo d}n5t |d|i }|ddjo|d }n|i i |||||S( ss Return a DocTest for the given object, if it defines a docstring; otherwise, return None. RlRis.pycs.pyoiN(s.pycs.pyo( R7RRR+R8RAtAttributeErrort _find_linenoRR,R4RR( RjRR'RBR.RRRRN((s/usr/lib/python2.6/doctest.pyRs(      cCsd}ti|o d}nti|om|djodStidt|dd}x9t|D]'\}}|i|o |}PqnqnWnti |o |i }nti |o |i }nti |o |i}nti|o |i}nti|ot|ddd}n|dj ob|djo |dStid}x:t|t|D]}|i||o|SqWndS( s Return a line number of the given object's docstring. Note: this method assumes that the object has a docstring. is^\s*class\s*%s\bR4t-tco_firstlinenois(^|.*:)\s*\w*("|')N(R+R5R6RRXRR,RRRRRt func_codet istracebackttb_frametisframetf_codetiscodetrangeR&(RjRRRtpatRR((s/usr/lib/python2.6/doctest.pyRs@             N( R4RpRRtRRvRR+RuRRRR(((s/usr/lib/python2.6/doctest.pyRs ]  ? %cBseZdZddZddddZdZdZdZdZ d Z d Z d Z e id Zdd ZddedZddZdZRS(s2 A class used to run DocTest test cases, and accumulate statistics. The `run` method is used to process a single DocTest case. It returns a tuple `(f, t)`, where `t` is the number of test cases tried, and `f` is the number of test cases that failed. >>> tests = DocTestFinder().find(_TestClass) >>> runner = DocTestRunner(verbose=False) >>> tests.sort(key = lambda test: test.name) >>> for test in tests: ... print test.name, '->', runner.run(test) _TestClass -> TestResults(failed=0, attempted=2) _TestClass.__init__ -> TestResults(failed=0, attempted=2) _TestClass.get -> TestResults(failed=0, attempted=2) _TestClass.square -> TestResults(failed=0, attempted=1) The `summarize` method prints a summary of all the test cases that have been run by the runner, and returns an aggregated `(f, t)` tuple: >>> runner.summarize(verbose=1) 4 items passed all tests: 2 tests in _TestClass 2 tests in _TestClass.__init__ 2 tests in _TestClass.get 1 tests in _TestClass.square 7 tests in 4 items. 7 passed and 0 failed. Test passed. TestResults(failed=0, attempted=7) The aggregated number of tried examples and failed examples is also available via the `tries` and `failures` attributes: >>> runner.tries 7 >>> runner.failures 0 The comparison between expected outputs and actual outputs is done by an `OutputChecker`. This comparison may be customized with a number of option flags; see the documentation for `testmod` for more information. If the option flags are insufficient, then the comparison may also be customized by passing a subclass of `OutputChecker` to the constructor. The test runner's display output can be controlled in two ways. First, an output function (`out) can be passed to `TestRunner.run`; this function will be called with strings that should be displayed. It defaults to `sys.stdout.write`. If capturing the output is not sufficient, then the display output can be also customized by subclassing DocTestRunner, and overriding the methods `report_start`, `report_success`, `report_unexpected_exception`, and `report_failure`. R3iFicCsy|pt|_|djodtij}n||_||_||_d|_d|_ h|_ t |_ dS(sc Create a new test runner. Optional keyword arg `checker` is the `OutputChecker` that should be used to compare the expected outputs and actual outputs of doctest examples. Optional keyword arg 'verbose' prints lots of stuff if true, only failures if false; by default, it's true iff '-v' is in sys.argv. Optional argument `optionflags` can be used to control how the test runner compares expected output to actual output, and how it displays failures. See the documentation for `testmod` for more information. s-viN( Rt_checkerR+R=RRt optionflagstoriginal_optionflagsttriestfailurest_name2ftRgt_fakeout(RjtcheckerRR((s/usr/lib/python2.6/doctest.pyRPs       cCsc|ioU|io,|dt|idt|iq_|dt|idndS(s Report that the test runner is about to process the given example. (Only displays a message if verbose=True) sTrying: s Expecting: sExpecting nothing N(RRwR\R(RjRRtexample((s/usr/lib/python2.6/doctest.pyt report_startts   )cCs|io|dndS(st Report that the given example ran successfully. (Only displays a message if verbose=True) sok N(R(RjRRRRx((s/usr/lib/python2.6/doctest.pytreport_successs cCs3||i|||ii|||idS(s7 Report that the given example failed. N(t_failure_headerRtoutput_differenceR(RjRRRRx((s/usr/lib/python2.6/doctest.pytreport_failurescCs.||i||dtt|dS(sO Report that the given example raised an unexpected exception. sException raised: N(RR\Rf(RjRRRRa((s/usr/lib/python2.6/doctest.pytreport_unexpected_exceptionscCs|ig}|iob|idj o(|idj o|i|id}nd}|id|i||ifn"|id|id|if|id|i}|it|di|S(Nit?sFile "%s", line %s, in %ssLine %s, in %ssFailed example:s ( tDIVIDERRNRR+RR'RR\R(RjRRRRR((s/usr/lib/python2.6/doctest.pyRs    !  c Bsd}}|i}ed\}}} |ii} xNe|iD]=\} } |ie@o |dj} ||_| ioNxK| iiD]6\}}|o|i|O_q|i|M_qWn|ie @oqDn|d7}| p|i ||| nd|i | f}y7e | i |d|d|iU|iid }Wn5ej o n!ei}|iinX|ii}|iid|}|d jo'| | i||io |}qnei}ei|d d}| p|e|7}n| id jo | }n| | i||io |}nz|ie@okeid| i}eid|}|o9|o2| |i d|i d|io |}qn||jo%| p|i!||| |qqD||jo/| p|i"||| |n|d7}qD|| jo/| p|i#||| |n|d7}qDqDW||_|i$|||e%||S( s Run the examples in `test`. Write the outcome of each example with one of the `DocTestRunner.report_*` methods, using the writer function `out`. `compileflags` is the set of compiler flags that should be used to execute examples. Return a tuple `(f, t)`, where `t` is the number of examples tried, and `f` is the number of examples that failed. The examples are run in the namespace `test.globs`. iiistsingleiis[^:]*:N(&RR Rt check_outputRRR RRRRR'RRR.tdebuggerRR+tKeyboardInterruptR=RaRR`RmRwR^tformat_exception_onlyRfRRRXRRRRRt_DocTestRunner__record_outcomeR#(RjRt compileflagsRRRRtSUCCESStFAILUREtBOOMtcheckt examplenumRtquiett optionflagRRNt exceptionRxtoutcomeRaRtm1tm2((s/usr/lib/python2.6/doctest.pyt__runs                )      cCs^|ii|id\}}||||f|i|i<|i|7_|i|7_dS(s{ Record the fact that the given DocTest (`test`) generated `f` failures out of `t` tried examples. iN(ii(RR*R'RR(RjRtftttf2tt2((s/usr/lib/python2.6/doctest.pyt__record_outcome'ss3[\w\.]+)\[(?P\d+)\]>$cCs|ii|}|o^|id|iijoB|iit|id}|iidd}|i t S|i ||SdS(NR'R+tasciiRT( t%_DocTestRunner__LINECACHE_FILENAME_RERRRR'RtintRRVt splitlinesRvtsave_linecache_getlines(RjRNtmodule_globalsRRR((s/usr/lib/python2.6/doctest.pyt__patched_linecache_getlines4s #cCs||_|djot|i}nti}|djo |i}n|it_ti }t ||_ |i i |i i t_ t i|_|it _ti}tit_z|i|||SWd|t_|t_ |it _|t_|o|iinXdS(sJ Run the examples in `test`, and display the results using the writer function `out`. The examples are run in the namespace `test.globs`. If `clear_globs` is true (the default), then this namespace will be cleared after the test runs, to help with garbage collection. If you would like to examine the namespace after the test completes, then use `clear_globs=False`. `compileflags` gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to `globs`. The output of each example is checked using `DocTestRunner.check_output`, and the results are formatted by the `DocTestRunner.report_*` methods. N(RR+R2R.R=RtwriteRRRRR"tresetRRR<t*_DocTestRunner__patched_linecache_getlinest displayhookt__displayhook__t_DocTestRunner__runtclear(RjRR&Rt clear_globsRtsave_set_tracetsave_displayhook((s/usr/lib/python2.6/doctest.pytrun=s.                c Cs"|djo |i}ng}g}g}d}}x|iiD]{}|\}\} } || 7}|| 7}| djo|i|qF| djo|i|| fqF|i|qFW|o|o7t|GdGH|ix|D]} dG| GHqWn|oCt|GdGH|ix'|D]\} } d| | fGHq1WqXn|oT|iGHt|GdGH|ix0|D]$\} \} } d| | | fGHqWn|o3|GdGt|iGd GH||Gd G|Gd GHn|od G|Gd GHn|o dGHnt||S(s Print a summary of all the test cases that have been run by this DocTestRunner, and return a tuple `(f, t)`, where `f` is the total number of failed examples, and `t` is the total number of tried examples. The optional `verbose` argument controls how detailed the summary is. If the verbosity is not specified, then the DocTestRunner's verbosity is used. isitems had no tests:s sitems passed all tests:s %3d tests in %ssitems had failures:s %3d of %3d in %sstests insitems.s passed andsfailed.s***Test Failed***s failures.s Test passed.N( R+RRRRR&RRR#( RjRtnoteststpassedtfailedttotaltttotalfRR'R3R4tthingR((s/usr/lib/python2.6/doctest.pyt summarize{sX            cCsx|i}xh|iiD]W\}\}}||jo(||\}}||}||}n||f|| 9cBs)eZdZdZdZdZRS(s_ A class used to check the whether the actual output from a doctest example matches the expected output. `OutputChecker` defines two methods: `check_output`, which compares a given pair of outputs, and returns true if they match; and `output_difference`, which returns a string describing the differences between two outputs. cCs||jotS|t@p4||fd jotS||fd jotSn|t@pMtidtitd|}tidd|}||jotSn|t@o@di|i }di|i }||jotSn|t @ot ||otSnt S( s Return True iff the actual output from an example (`got`) matches the expected output (`want`). These strings are always considered to match if they are identical; but depending on what option flags the test runner is using, several non-exact match types are also possible. See the documentation for `TestRunner` for more information about option flags. sTrue s1 sFalse s0 s (?m)^%s\s*?$Rls (?m)^\s*?$RU(sTrue s1 (sFalse s0 ( RvRRRXRYtescapetBLANKLINE_MARKERRRRrRR}Rt(RjRwRxR((s/usr/lib/python2.6/doctest.pyR!s,            cCsQ|ttBtB@ptS|t@otS|iddjo|iddjS(Ns i(RR R RtRvR(RjRwRxR((s/usr/lib/python2.6/doctest.pyt_do_a_fancy_diffs  c Cs|i}|t@ptidt|}n|i|||o!|it}|it}|t@o2t i ||dd}t |d}d}n|t @o2t i ||dd}t |d}d}nC|t@o7t idt i} t | i||}d}ng} |D]} | | idq(~ }d |td i|S|o"|od t|t|fS|od t|S|od t|SdSdS(s Return a string describing the differences between the expected output for a given example (`example`) and the actual output (`got`). `optionflags` is the set of option flags used to compare `want` and `got`. s(?m)^[ ]*(?= )tnis#unified diff with -expected +actuals-context diff with expected followed by actualtcharjunksndiff with -expected +actuals sDifferences (%s): RlsExpected: %sGot: %ssExpected: %sGot nothing sExpected nothing Got: %ssExpected nothing Got nothing N(RwRRXRYRTRUR;RvRtdifflibt unified_difftlistR t context_diffR tDiffertIS_CHARACTER_JUNKtcompareRR\R( RjRRxRRwRt got_linestdifftkindtengineRR((s/usr/lib/python2.6/doctest.pyRs6        +(R4RpRR!RUR(((s/usr/lib/python2.6/doctest.pyRs 6 cBs eZdZdZdZRS(sA DocTest example has failed in debugging mode. The exception instance has variables: - test: the DocTest object being run - example: the Example object that failed - got: the actual output cCs||_||_||_dS(N(RRRx(RjRRRx((s/usr/lib/python2.6/doctest.pyRQs  cCs t|iS(N(R8R(Rj((s/usr/lib/python2.6/doctest.pyt__str__Vs(R4RpRRRc(((s/usr/lib/python2.6/doctest.pyRFs  cBs eZdZdZdZRS(sA DocTest example has encountered an unexpected exception The exception instance has variables: - test: the DocTest object being run - example: the Example object that failed - exc_info: the exception info cCs||_||_||_dS(N(RRRa(RjRRRa((s/usr/lib/python2.6/doctest.pyRds  cCs t|iS(N(R8R(Rj((s/usr/lib/python2.6/doctest.pyRcis(R4RpRRRc(((s/usr/lib/python2.6/doctest.pyRYs  cBs2eZdZddedZdZdZRS(s{ Run doc tests but raise an exception as soon as there is a failure. If an unexpected exception occurs, an UnexpectedException is raised. It contains the test, the example, and the original exception: >>> runner = DebugRunner(verbose=False) >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> try: ... runner.run(test) ... except UnexpectedException, failure: ... pass >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError We wrap the original exception to give the calling application access to the test and example information. If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> try: ... runner.run(test) ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n' If a failure or error occurs, the globals are left intact: >>> del test.globs['__builtins__'] >>> test.globs {'x': 1} >>> test = DocTestParser().get_doctest(''' ... >>> x = 2 ... >>> raise KeyError ... ''', {}, 'foo', 'foo.py', 0) >>> runner.run(test) Traceback (most recent call last): ... UnexpectedException: >>> del test.globs['__builtins__'] >>> test.globs {'x': 2} But the globals are cleared if there is no error: >>> test = DocTestParser().get_doctest(''' ... >>> x = 2 ... ''', {}, 'foo', 'foo.py', 0) >>> runner.run(test) TestResults(failed=0, attempted=1) >>> test.globs {} cCs7ti||||t}|o|iin|S(N(RRIRtR.RE(RjRR&RRFtr((s/usr/lib/python2.6/doctest.pyRIscCst|||dS(N(R(RjRRRRa((s/usr/lib/python2.6/doctest.pyRscCst|||dS(N(R(RjRRRRx((s/usr/lib/python2.6/doctest.pyRsN(R4RpRR+RvRIRR(((s/usr/lib/python2.6/doctest.pyRlsY ic Cs*|djotiid}nti|ptd|fn|djo |i}ntd|} |ot d|d|} nt d|d|} x3| i ||d|d|D]} | i | qW|o| i ntdjo | anti| t| i| iS( s, m=None, name=None, globs=None, verbose=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, exclude_empty=False Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), starting with m.__doc__. Also test examples reachable from dict m.__test__ if it exists and is not None. m.__test__ maps names to functions, classes and strings; function and class docstrings are tested even if the name is private; strings are tested directly, as if they were docstrings. Return (#failures, #tests). See doctest.__doc__ for an overview. Optional keyword arg "name" gives the name of the module; by default use m.__name__. Optional keyword arg "globs" gives a dict to be used as the globals when executing examples; by default, use m.__dict__. A copy of this dict is actually used for each docstring, so that each docstring's examples start with a clean slate. Optional keyword arg "extraglobs" gives a dictionary that should be merged into the globals that are used to execute examples. By default, no extra globals are used. This is new in 2.4. Optional keyword arg "verbose" prints lots of stuff if true, prints only failures if false; by default, it's true iff "-v" is in sys.argv. Optional keyword arg "report" prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else very brief (in fact, empty if all tests passed). Optional keyword arg "optionflags" or's together module constants, and defaults to 0. This is new in 2.3. Possible values (see the docs for details): DONT_ACCEPT_TRUE_FOR_1 DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS SKIP IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF REPORT_NDIFF REPORT_ONLY_FIRST_FAILURE Optional keyword arg "raise_on_error" raises an exception on the first unexpected exception or failure. This allows failures to be post-mortem debugged. Advanced tomfoolery: testmod runs methods of a local instance of class doctest.Tester, then merges the results into (or creates) global Tester instance doctest.master. Methods of doctest.master can be called directly too, if you want to do something unusual. Passing report=0 to testmod is especially useful then, to delay displaying a summary. Invoke doctest.master.summarize(verbose) when you're done fiddling. Rstestmod: module required; %rRRRR.RN(R+R=R>R*R5R6RAR4RRRRuRIRPtmasterRRR#RR( RR'R.RtreportRRtraise_on_errorRtfindertrunnerR((s/usr/lib/python2.6/doctest.pyRs&E      c Cs|o| otdnt|||\} }|djotii|}n|djo h}n |i}|dj o|i|nd|jod|d>> import doctest >>> old = doctest._unittest_reportflags >>> doctest.set_unittest_reportflags(REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) == old True >>> doctest._unittest_reportflags == (REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) True Only reporting flags can be set: >>> doctest.set_unittest_reportflags(ELLIPSIS) Traceback (most recent call last): ... ValueError: ('Only reporting flags allowed', 8) >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) True sOnly reporting flags allowed(R Rt_unittest_reportflags(R/told((s/usr/lib/python2.6/doctest.pyRs t DocTestCasecBskeZdd d d dZdZdZdZdZdZdZ dZ e Z d Z RS( icCsAtii|||_||_||_||_||_dS(N(tunittesttTestCaseRt_dt_optionflagst _dt_checkert_dt_testt _dt_setUpt _dt_tearDown(RjRRtsetUpttearDownR((s/usr/lib/python2.6/doctest.pyREs     cCs.|i}|idj o|i|ndS(N(RRR+(RjR((s/usr/lib/python2.6/doctest.pyROs cCs;|i}|idj o|i|n|iidS(N(RRR+R.RE(RjR((s/usr/lib/python2.6/doctest.pyRUs c Cs|i}ti}t}|i}|t@p|tO}ntd|d|idt }z5dd|_ |i |d|i dt \}}Wd|t_X|o"|i |i|indS(NRRRRiFRRF(RR=RR!RR R|RRRtRRIR?tfailureExceptiontformat_failureR`(RjRR}tnewRRiRR((s/usr/lib/python2.6/doctest.pytrunTest]s       " cCsl|i}|idjo d}nd|i}di|iidd}d|i|i|||fS(Nsunknown line numbers%sRis:Failed doctest test for %s File "%s", line %s, in %s %s(RRR+RR'RrRN(RjterrRRtlname((s/usr/lib/python2.6/doctest.pyRus   cCsO|itd|id|idt}|i|idt|idS(sRun the test case without results and without catching exceptions The unit test framework includes a debug method on test cases and test suites to support post-mortem debugging. The test code is run in such a way that errors are not caught. This way a caller can catch the errors and initiate post-mortem debugging. The DocTestCase provides a debug method that raises UnexpectedException errors if there is an unexepcted exception: >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except UnexpectedException, failure: ... pass The UnexpectedException contains the test, the example, and the original exception: >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n' RRRRFN(RRRRRtRIRR(RjRi((s/usr/lib/python2.6/doctest.pyR s B cCs |iiS(N(RR'(Rj((s/usr/lib/python2.6/doctest.pyRscCs4|iiid}d|ddi|d fS(NRs%s (%s)i(RR'RrR(RjR'((s/usr/lib/python2.6/doctest.pyRscCsd|iiS(Ns Doctest: (RR'(Rj((s/usr/lib/python2.6/doctest.pytshortDescriptionsN( R4RpR+RRRRRR RRRcR(((s/usr/lib/python2.6/doctest.pyR~Cs     H  c Ks|d jo t}nt|}|i|d|d|}|pt|dn|iti}x|D]x}t|i djoqxn|i p5|i }|dd jo|d }n||_ n|i t ||qxW|S( s Convert doctest tests for a module to a unittest test suite. This converts each documentation string in a module that contains doctest tests to a unittest test case. If any of the tests in a doc string fail, then the test case fails. An exception is raised showing the name of the file containing the test and a (sometimes approximate) line number. The `module` argument provides the module to be tested. The argument can be either a module or a module name. If no argument is given, the calling module is used. A number of options may be provided as keyword arguments: setUp A set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown A tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. R.Rs has no testsiis.pycs.pyoiN(s.pycs.pyo(R+RRDRuRRRt TestSuiteR&RRNRtaddTestR~( RBR.Rt test_finderRRtsuiteRRN((s/usr/lib/python2.6/doctest.pyRs&%        t DocFileCasecBs)eZdZdZeZdZRS(cCsdi|iiidS(Nt_R(RRR'Rr(Rj((s/usr/lib/python2.6/doctest.pyR scCs |iiS(N(RRN(Rj((s/usr/lib/python2.6/doctest.pyR scCsd|ii|ii|fS(Ns2Failed doctest test for %s File "%s", line 0 %s(RR'RN(RjR((s/usr/lib/python2.6/doctest.pyR s(R4RpRRRcR(((s/usr/lib/python2.6/doctest.pyR s  c Ks|djo h}n |i}|o| otdnt|||\}}d|jo||d>> text = ''' ... Here are examples of simple math. ... ... Python has super accurate integer addition ... ... >>> 2 + 2 ... 5 ... ... And very friendly error messages: ... ... >>> 1/0 ... To Infinity ... And ... Beyond ... ... You can use logic if you want: ... ... >>> if 0: ... ... blah ... ... blah ... ... ... ... Ho hum ... ''' >>> print script_from_examples(text) # Here are examples of simple math. # # Python has super accurate integer addition # 2 + 2 # Expected: ## 5 # # And very friendly error messages: # 1/0 # Expected: ## To Infinity ## And ## Beyond # # You can use logic if you want: # if 0: blah blah # # Ho hum is # Expected:s s## R~i( RRR7R RRRwRrRtpopR(RZRtpieceRwRRR((s/usr/lib/python2.6/doctest.pyR s$:  > 2cCst|}ti|}g}|D]!}|i|jo ||q)q)~}|pt|dn|d}t|i}|S(sExtract the test sources from a doctest docstring as a script. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the doc string with tests to be debugged. snot found in testsi(RDRRuR'RRR(RBR'RRR4Rttestsrc((s/usr/lib/python2.6/doctest.pyR s 5 cCs t|}t|||dS(s4Debug a single doctest docstring, in argument `src`'N(Rt debug_script(tsrctpmR.R((s/usr/lib/python2.6/doctest.pyR s c Csddk}tidd}t|d}|i||iz|o|i}nh}|oHyt|||Wqti dGH|i ti dqXn|i d|||Wdt i |XdS( s7Debug a test script. `src` is the script, as a string.iNs.pyt doctestdebugR|iis execfile(%r)(RttempfiletmktempRLR?tcloseRtexecfileR=Rat post_mortemRIRJtremove(RRR.Rt srcfilenameR3((s/usr/lib/python2.6/doctest.pyR s"   cCs2t|}t||}t|||idS(sDebug a single doctest docstring. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the docstring with tests to be debugged. N(RDRRR(RBR'RR((s/usr/lib/python2.6/doctest.pyR s t _TestClasscBs)eZdZdZdZdZRS(s A pointless class, for sanity-checking of docstring testing. Methods: square() get() >>> _TestClass(13).get() + _TestClass(-12).get() 1 >>> hex(_TestClass(13).square().get()) '0xa9' cCs ||_dS(sval -> _TestClass object with associated value val. >>> t = _TestClass(123) >>> print t.get() 123 N(R(RjR((s/usr/lib/python2.6/doctest.pyR) scCs|id|_|S(sosquare() -> square TestClass's associated value >>> _TestClass(13).square().get() 169 i(R(Rj((s/usr/lib/python2.6/doctest.pytsquare3 scCs|iS(s}get() -> return TestClass's associated value. >>> x = _TestClass(-42) >>> print x.get() -42 (R(Rj((s/usr/lib/python2.6/doctest.pyR*= s(R4RpRRRR*(((s/usr/lib/python2.6/doctest.pyR s  s Example of a string object, searched as-is. >>> x = 1; y = 2 >>> x + y, x * y (3, 2) Rs In 2.2, boolean expressions displayed 0 or 1. By default, we still accept them. This can be disabled by passing DONT_ACCEPT_TRUE_FOR_1 to the new optionflags argument. >>> 4 == 4 1 >>> 4 == 4 True >>> 4 > 4 0 >>> 4 > 4 False sbool-int equivalences Blank lines can be marked with : >>> print 'foo\n\nbar\n' foo bar s blank liness If the ellipsis flag is used, then '...' can be used to elide substrings in the desired output: >>> print range(1000) #doctest: +ELLIPSIS [0, 1, 2, ..., 999] tellipsiss| If the whitespace normalization flag is used, then differences in whitespace are ignored. >>> print range(30) #doctest: +NORMALIZE_WHITESPACE [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] swhitespace normalizationc Csg}tidD])}|o|ddjo ||qq~}|ox|D]}|ido[tii|\}}tiid|t|d }tid=t|\}}nt |dt \}}|odSqRWnt i }|i tdS(NiiRs.pyiRP(R=RRiRJRRrtinsertR:RRRtRtTextTestRunnerRIR( Rtargt testfilesRNtdirnameRRRRd((s/usr/lib/python2.6/doctest.pyt_testy s D   R(URt __docformat__t__all__R(R=R^R5RRJRXRRXRRRoR!t collectionsR"R#R$RRRRRRRRRR R R R RTRqR2RDRRR,t __stdout__R+RWR\RfRgR}RRRRGR RRRRRt ExceptionRRRReRvRtRRRRR|RRR~RRRRRRRRR RRRR4texit(((s/usr/lib/python2.6/doctest.pyt.s  H0                 1 $ $5<)n  f    z? $=   I R  ,