/usr/lib64/python2.6
NameSizeModeActions
bsddb/-0755rm
compiler/-0755rm
config/-0755rm
ctypes/-0755rm
curses/-0755rm
Demo/-0755rm
distutils/-0755rm
Doc/-0755rm
email/-0755rm
encodings/-0755rm
hotshot/-0755rm
idlelib/-0755rm
json/-0755rm
lib-dynload/-0755rm
lib-tk/-0755rm
lib2to3/-0755rm
logging/-0755rm
multiprocessing/-0755rm
plat-linux2/-0755rm
site-packages/-0755rm
sqlite3/-0755rm
test/-0755rm
Tools/-0755rm
wsgiref/-0755rm
xml/-0755rm
abc.py70340644editdlrm
abc.pyc60710644editdlrm
abc.pyo60130644editdlrm
aifc.py331880644editdlrm
aifc.pyc295640644editdlrm
aifc.pyo295640644editdlrm
anydbm.py26200644editdlrm
anydbm.pyc27750644editdlrm
anydbm.pyo27750644editdlrm
ast.py113470644editdlrm
ast.pyc127800644editdlrm
ast.pyo127800644editdlrm
asynchat.py114020644editdlrm
asynchat.pyc87370644editdlrm
asynchat.pyo87370644editdlrm
asyncore.py200610644editdlrm
asyncore.pyc184520644editdlrm
asyncore.pyo184520644editdlrm
atexit.py17050644editdlrm
atexit.pyc22150644editdlrm
atexit.pyo22150644editdlrm
audiodev.py75970644editdlrm
audiodev.pyc85370644editdlrm
audiodev.pyo85370644editdlrm
base64.py113350755editdlrm
base64.pyc110030644editdlrm
base64.pyo110030644editdlrm
BaseHTTPServer.py219740644editdlrm
BaseHTTPServer.pyc215750644editdlrm
BaseHTTPServer.pyo215750644editdlrm
Bastion.py57440644editdlrm
Bastion.pyc66670644editdlrm
Bastion.pyo66670644editdlrm
bdb.py205970644editdlrm
bdb.pyc185670644editdlrm
bdb.pyo185670644editdlrm
binhex.py148780644editdlrm
binhex.pyc158750644editdlrm
binhex.pyo158750644editdlrm
bisect.py26620644editdlrm
bisect.pyc31730644editdlrm
bisect.pyo31730644editdlrm
calendar.py231100644editdlrm
calendar.pyc281650644editdlrm
calendar.pyo281650644editdlrm
cgi.py344780755editdlrm
cgi.pyc328180644editdlrm
cgi.pyo328180644editdlrm
CGIHTTPServer.py127730644editdlrm
CGIHTTPServer.pyc108200644editdlrm
CGIHTTPServer.pyo108200644editdlrm
cgitb.py121550644editdlrm
cgitb.pyc124610644editdlrm
cgitb.pyo124610644editdlrm
chunk.py53720644editdlrm
chunk.pyc56450644editdlrm
chunk.pyo56450644editdlrm
cmd.py149620644editdlrm
cmd.pyc139540644editdlrm
cmd.pyo139540644editdlrm
code.py102170644editdlrm
code.pyc104270644editdlrm
code.pyo104270644editdlrm
codecs.py352660644editdlrm
codecs.pyc367210644editdlrm
codecs.pyo367210644editdlrm
codeop.py59990644editdlrm
codeop.pyc66360644editdlrm
codeop.pyo66360644editdlrm
collections.py137300644editdlrm
collections.pyc144620644editdlrm
collections.pyo144090644editdlrm
colorsys.py34590644editdlrm
colorsys.pyc40410644editdlrm
colorsys.pyo40410644editdlrm
commands.py25430644editdlrm
commands.pyc24890644editdlrm
commands.pyo24890644editdlrm
compileall.py52850644editdlrm
compileall.pyc49970644editdlrm
compileall.pyo49970644editdlrm
ConfigParser.py259890644editdlrm
ConfigParser.pyc238650644editdlrm
ConfigParser.pyo238650644editdlrm
contextlib.py41360644editdlrm
contextlib.pyc41510644editdlrm
contextlib.pyo41510644editdlrm
Cookie.py250540644editdlrm
Cookie.pyc221450644editdlrm
Cookie.pyo221450644editdlrm
cookielib.py647260644editdlrm
cookielib.pyc553700644editdlrm
cookielib.pyo551790644editdlrm
copy.py111770644editdlrm
copy.pyc116750644editdlrm
copy.pyo115790644editdlrm
copy_reg.py68000644editdlrm
copy_reg.pyc51780644editdlrm
copy_reg.pyo51320644editdlrm
cProfile.py63370755editdlrm
cProfile.pyc62390644editdlrm
cProfile.pyo62390644editdlrm
crypt.py22290644editdlrm
crypt.pyc30550644editdlrm
crypt.pyo30550644editdlrm
csv.py157300644editdlrm
csv.pyc132260644editdlrm
csv.pyo132260644editdlrm
dbhash.py5350644editdlrm
dbhash.pyc7600644editdlrm
dbhash.pyo7600644editdlrm
decimal.py1992730644editdlrm
decimal.pyc1556810644editdlrm
decimal.pyo1556150644editdlrm
difflib.py810800644editdlrm
difflib.pyc611930644editdlrm
difflib.pyo611390644editdlrm
dircache.py11260644editdlrm
dircache.pyc15840644editdlrm
dircache.pyo15840644editdlrm
dis.py64490644editdlrm
dis.pyc63660644editdlrm
dis.pyo63660644editdlrm
doctest.py1015160644editdlrm
doctest.pyc809940644editdlrm
doctest.pyo807060644editdlrm
DocXMLRPCServer.py105990644editdlrm
DocXMLRPCServer.pyc99570644editdlrm
DocXMLRPCServer.pyo98490644editdlrm
dumbdbm.py88200644editdlrm
dumbdbm.pyc65850644editdlrm
dumbdbm.pyo65850644editdlrm
dummy_thread.py44180644editdlrm
dummy_thread.pyc54130644editdlrm
dummy_thread.pyo54130644editdlrm
dummy_threading.py28040644editdlrm
dummy_threading.pyc12970644editdlrm
dummy_threading.pyo12970644editdlrm
filecmp.py94700644editdlrm
filecmp.pyc96320644editdlrm
filecmp.pyo96320644editdlrm
fileinput.py141430644editdlrm
fileinput.pyc149280644editdlrm
fileinput.pyo149280644editdlrm
fnmatch.py32390644editdlrm
fnmatch.pyc35790644editdlrm
fnmatch.pyo35790644editdlrm
formatter.py149110644editdlrm
formatter.pyc193030644editdlrm
formatter.pyo193030644editdlrm
fpformat.py46990644editdlrm
fpformat.pyc47350644editdlrm
fpformat.pyo47350644editdlrm
fractions.py200730644editdlrm
fractions.pyc181190644editdlrm
fractions.pyo181190644editdlrm
ftplib.py291970644editdlrm
ftplib.pyc285030644editdlrm
ftplib.pyo285030644editdlrm
functools.py21620644editdlrm
functools.pyc19270644editdlrm
functools.pyo19270644editdlrm
genericpath.py30200644editdlrm
genericpath.pyc32920644editdlrm
genericpath.pyo32920644editdlrm
getopt.py73280644editdlrm
getopt.pyc67300644editdlrm
getopt.pyo66830644editdlrm
getpass.py55340644editdlrm
getpass.pyc47540644editdlrm
getpass.pyo47540644editdlrm
gettext.py199680644editdlrm
gettext.pyc157600644editdlrm
gettext.pyo157600644editdlrm
glob.py22490644editdlrm
glob.pyc24090644editdlrm
glob.pyo24090644editdlrm
gzip.py167540644editdlrm
gzip.pyc143860644editdlrm
gzip.pyo143860644editdlrm
hashlib.py44270644editdlrm
hashlib.pyc39810644editdlrm
hashlib.pyo39810644editdlrm
heapq.py159950644editdlrm
heapq.pyc126940644editdlrm
heapq.pyo126940644editdlrm
hmac.py45310644editdlrm
hmac.pyc45090644editdlrm
hmac.pyo45090644editdlrm
htmlentitydefs.py180540644editdlrm
htmlentitydefs.pyc63710644editdlrm
htmlentitydefs.pyo63710644editdlrm
htmllib.py128690644editdlrm
htmllib.pyc203840644editdlrm
htmllib.pyo203840644editdlrm
HTMLParser.py135760644editdlrm
HTMLParser.pyc122580644editdlrm
HTMLParser.pyo119500644editdlrm
httplib.py487970644editdlrm
httplib.pyc377320644editdlrm
httplib.pyo375360644editdlrm
ihooks.py174520644editdlrm
ihooks.pyc208370644editdlrm
ihooks.pyo207580644editdlrm
imaplib.py477710644editdlrm
imaplib.pyc452250644editdlrm
imaplib.pyo424750644editdlrm
imghdr.py35440644editdlrm
imghdr.pyc49050644editdlrm
imghdr.pyo49050644editdlrm
imputil.py260090644editdlrm
imputil.pyc160370644editdlrm
imputil.pyo158650644editdlrm
inspect.py381890644editdlrm
inspect.pyc371650644editdlrm
inspect.pyo371650644editdlrm
io.py661650644editdlrm
io.pyc630420644editdlrm
io.pyo630420644editdlrm
keyword.py19970755editdlrm
keyword.pyc21170644editdlrm
keyword.pyo21170644editdlrm
linecache.py41280644editdlrm
linecache.pyc32680644editdlrm
linecache.pyo32680644editdlrm
locale.py826740644editdlrm
locale.pyc466760644editdlrm
locale.pyo466760644editdlrm
macpath.py62530644editdlrm
macpath.pyc77070644editdlrm
macpath.pyo77070644editdlrm
macurl2path.py32750644editdlrm
macurl2path.pyc28250644editdlrm
macurl2path.pyo28250644editdlrm
mailbox.py758240644editdlrm
mailbox.pyc760690644editdlrm
mailbox.pyo760200644editdlrm
mailcap.py84020644editdlrm
mailcap.pyc80790644editdlrm
mailcap.pyo80790644editdlrm
markupbase.py143500644editdlrm
markupbase.pyc94640644editdlrm
markupbase.pyo92700644editdlrm
md5.py4100644editdlrm
md5.pyc3780644editdlrm
md5.pyo3780644editdlrm
mhlib.py334340644editdlrm
mhlib.pyc341370644editdlrm
mhlib.pyo341370644editdlrm
mimetools.py71680644editdlrm
mimetools.pyc83200644editdlrm
mimetools.pyo83200644editdlrm
mimetypes.py188220644editdlrm
mimetypes.pyc168720644editdlrm
mimetypes.pyo168720644editdlrm
MimeWriter.py64820644editdlrm
MimeWriter.pyc73830644editdlrm
MimeWriter.pyo73830644editdlrm
mimify.py150240755editdlrm
mimify.pyc122190644editdlrm
mimify.pyo122190644editdlrm
modulefinder.py242830644editdlrm
modulefinder.pyc190070644editdlrm
modulefinder.pyo189190644editdlrm
multifile.py48200644editdlrm
multifile.pyc54790644editdlrm
multifile.pyo54350644editdlrm
mutex.py18660644editdlrm
mutex.pyc25260644editdlrm
mutex.pyo25260644editdlrm
netrc.py41110644editdlrm
netrc.pyc36020644editdlrm
netrc.pyo36020644editdlrm
new.py7060644editdlrm
new.pyc9100644editdlrm
new.pyo9100644editdlrm
nntplib.py214700644editdlrm
nntplib.pyc211790644editdlrm
nntplib.pyo211790644editdlrm
ntpath.py177520644editdlrm
ntpath.pyc116200644editdlrm
ntpath.pyo115730644editdlrm
nturl2path.py22390644editdlrm
nturl2path.pyc17770644editdlrm
nturl2path.pyo17770644editdlrm
numbers.py102710644editdlrm
numbers.pyc139640644editdlrm
numbers.pyo139640644editdlrm
opcode.py52480644editdlrm
opcode.pyc59170644editdlrm
opcode.pyo59170644editdlrm
optparse.py608490644editdlrm
optparse.pyc542390644editdlrm
optparse.pyo541570644editdlrm
ordereddict.py360644editdlrm
ordereddict.pyc1850644editdlrm
ordereddict.pyo1850644editdlrm
os.py258020644editdlrm
os.pyc258080644editdlrm
os.pyo258080644editdlrm
os2emxpath.py46030644editdlrm
os2emxpath.pyc45360644editdlrm
os2emxpath.pyo45360644editdlrm
pdb.doc78990644editdlrm
pdb.py453330755editdlrm
pdb.pyc438130644editdlrm
pdb.pyo438130644editdlrm
pickle.py448110644editdlrm
pickle.pyc386450644editdlrm
pickle.pyo384400644editdlrm
pickletools.py743480644editdlrm
pickletools.pyc571430644editdlrm
pickletools.pyo562460644editdlrm
pipes.py96470644editdlrm
pipes.pyc94600644editdlrm
pipes.pyo94600644editdlrm
pkgutil.py200010644editdlrm
pkgutil.pyc190200644editdlrm
pkgutil.pyo190200644editdlrm
platform.py526300755editdlrm
platform.pyc387970644editdlrm
platform.pyo387970644editdlrm
plistlib.py158060644editdlrm
plistlib.pyc200500644editdlrm
plistlib.pyo199600644editdlrm
popen2.py84160644editdlrm
popen2.pyc90640644editdlrm
popen2.pyo90200644editdlrm
poplib.py128250644editdlrm
poplib.pyc134180644editdlrm
poplib.pyo134180644editdlrm
posixfile.py80030644editdlrm
posixfile.pyc77240644editdlrm
posixfile.pyo77240644editdlrm
posixpath.py131190644editdlrm
posixpath.pyc111880644editdlrm
posixpath.pyo111880644editdlrm
pprint.py119320644editdlrm
pprint.pyc103940644editdlrm
pprint.pyo102190644editdlrm
profile.py235100755editdlrm
profile.pyc166800644editdlrm
profile.pyo164350644editdlrm
pstats.py273100644editdlrm
pstats.pyc253400644editdlrm
pstats.pyo253400644editdlrm
pty.py48690644editdlrm
pty.pyc49190644editdlrm
pty.pyo49190644editdlrm
pyclbr.py132820644editdlrm
pyclbr.pyc97320644editdlrm
pyclbr.pyo97320644editdlrm
pydoc.py924320755editdlrm
pydoc.pyc910520644editdlrm
pydoc.pyo909840644editdlrm
pydoc_topics.py4231260644editdlrm
pydoc_topics.pyc4075880644editdlrm
pydoc_topics.pyo4075880644editdlrm
py_compile.py56330644editdlrm
py_compile.pyc65540644editdlrm
py_compile.pyo65540644editdlrm
Queue.py85740644editdlrm
Queue.pyc94470644editdlrm
Queue.pyo94470644editdlrm
quopri.py69720755editdlrm
quopri.pyc66880644editdlrm
quopri.pyo66880644editdlrm
random.py319660644editdlrm
random.pyc251060644editdlrm
random.pyo251060644editdlrm
re.py129660644editdlrm
re.pyc131640644editdlrm
re.pyo131640644editdlrm
repr.py42960644editdlrm
repr.pyc54340644editdlrm
repr.pyo54340644editdlrm
rexec.py201520644editdlrm
rexec.pyc242200644editdlrm
rexec.pyo242200644editdlrm
rfc822.py332950644editdlrm
rfc822.pyc321100644editdlrm
rfc822.pyo321100644editdlrm
rlcompleter.py58660644editdlrm
rlcompleter.pyc60730644editdlrm
rlcompleter.pyo60730644editdlrm
robotparser.py70140644editdlrm
robotparser.pyc78520644editdlrm
robotparser.pyo78520644editdlrm
runpy.py54130644editdlrm
runpy.pyc39790644editdlrm
runpy.pyo39790644editdlrm
sched.py50910644editdlrm
sched.pyc50050644editdlrm
sched.pyo50050644editdlrm
sets.py190500644editdlrm
sets.pyc169970644editdlrm
sets.pyo169970644editdlrm
sgmllib.py178840644editdlrm
sgmllib.pyc155980644editdlrm
sgmllib.pyo155980644editdlrm
sha.py4450644editdlrm
sha.pyc4210644editdlrm
sha.pyo4210644editdlrm
shelve.py80780644editdlrm
shelve.pyc102960644editdlrm
shelve.pyo102960644editdlrm
shlex.py111370644editdlrm
shlex.pyc77100644editdlrm
shlex.pyo77100644editdlrm
shutil.py86320644editdlrm
shutil.pyc95550644editdlrm
shutil.pyo95550644editdlrm
SimpleHTTPServer.py74220644editdlrm
SimpleHTTPServer.pyc77660644editdlrm
SimpleHTTPServer.pyo77660644editdlrm
SimpleXMLRPCServer.py219920644editdlrm
SimpleXMLRPCServer.pyc196330644editdlrm
SimpleXMLRPCServer.pyo196330644editdlrm
site.py191870644editdlrm
site.pyc188250644editdlrm
site.pyo188250644editdlrm
smtpd.py189200755editdlrm
smtpd.pyc161880644editdlrm
smtpd.pyo161880644editdlrm
smtplib.py309240755editdlrm
smtplib.pyc297370644editdlrm
smtplib.pyo297370644editdlrm
sndhdr.py59730644editdlrm
sndhdr.pyc74200644editdlrm
sndhdr.pyo74200644editdlrm
socket.py201490644editdlrm
socket.pyc161290644editdlrm
socket.pyo160440644editdlrm
SocketServer.py223260644editdlrm
SocketServer.pyc231430644editdlrm
SocketServer.pyo231430644editdlrm
sre.py3840644editdlrm
sre.pyc5190644editdlrm
sre.pyo5190644editdlrm
sre_compile.py165070644editdlrm
sre_compile.pyc114830644editdlrm
sre_compile.pyo113700644editdlrm
sre_constants.py71370644editdlrm
sre_constants.pyc60930644editdlrm
sre_constants.pyo60930644editdlrm
sre_parse.py268780644editdlrm
sre_parse.pyc196960644editdlrm
sre_parse.pyo196960644editdlrm
ssl.py166770644editdlrm
ssl.pyc142760644editdlrm
ssl.pyo142760644editdlrm
stat.py17180644editdlrm
stat.pyc27030644editdlrm
stat.pyo27030644editdlrm
statvfs.py8980644editdlrm
statvfs.pyc6200644editdlrm
statvfs.pyo6200644editdlrm
string.py207450644editdlrm
string.pyc200660644editdlrm
string.pyo200660644editdlrm
StringIO.py106210644editdlrm
StringIO.pyc115320644editdlrm
StringIO.pyo115320644editdlrm
stringold.py124490644editdlrm
stringold.pyc125930644editdlrm
stringold.pyo125930644editdlrm
stringprep.py135220644editdlrm
stringprep.pyc145260644editdlrm
stringprep.pyo144520644editdlrm
struct.py820644editdlrm
struct.pyc2390644editdlrm
struct.pyo2390644editdlrm
subprocess.py579450644editdlrm
subprocess.pyc410710644editdlrm
subprocess.pyo410140644editdlrm
sunau.py165370644editdlrm
sunau.pyc180720644editdlrm
sunau.pyo180720644editdlrm
sunaudio.py13990644editdlrm
sunaudio.pyc19970644editdlrm
sunaudio.pyo19970644editdlrm
symbol.py20500755editdlrm
symbol.pyc30250644editdlrm
symbol.pyo30250644editdlrm
symtable.py79110644editdlrm
symtable.pyc126090644editdlrm
symtable.pyo124790644editdlrm
tabnanny.py113390755editdlrm
tabnanny.pyc83330644editdlrm
tabnanny.pyo83330644editdlrm
tarfile.py877860644editdlrm
tarfile.pyc739220644editdlrm
tarfile.pyo739220644editdlrm
telnetlib.py218080644editdlrm
telnetlib.pyc199130644editdlrm
telnetlib.pyo199130644editdlrm
tempfile.py177740644editdlrm
tempfile.pyc195710644editdlrm
tempfile.pyo195710644editdlrm
textwrap.py168890644editdlrm
textwrap.pyc117920644editdlrm
textwrap.pyo117000644editdlrm
this.py10020644editdlrm
this.pyc12410644editdlrm
this.pyo12410644editdlrm
threading.py318080644editdlrm
threading.pyc281520644editdlrm
threading.pyo260800644editdlrm
timeit.py120030644editdlrm
timeit.pyc118270644editdlrm
timeit.pyo118270644editdlrm
toaiff.py31420644editdlrm
toaiff.pyc31340644editdlrm
toaiff.pyo31340644editdlrm
token.py29470755editdlrm
token.pyc38400644editdlrm
token.pyo38400644editdlrm
tokenize.py163260644editdlrm
tokenize.pyc140180644editdlrm
tokenize.pyo139250644editdlrm
trace.py303250644editdlrm
trace.pyc230510644editdlrm
trace.pyo229890644editdlrm
traceback.py112110644editdlrm
traceback.pyc116770644editdlrm
traceback.pyo116770644editdlrm
tty.py8790644editdlrm
tty.pyc13170644editdlrm
tty.pyo13170644editdlrm
types.py23230644editdlrm
types.pyc26200644editdlrm
types.pyo26200644editdlrm
unittest.py311570644editdlrm
unittest.pyc348620644editdlrm
unittest.pyo348620644editdlrm
urllib.py590220644editdlrm
urllib.pyc513480644editdlrm
urllib.pyo512540644editdlrm
urllib2.py508660644editdlrm
urllib2.pyc458130644editdlrm
urllib2.pyo457190644editdlrm
urlparse.py156180644editdlrm
urlparse.pyc147770644editdlrm
urlparse.pyo147770644editdlrm
user.py16270644editdlrm
user.pyc17360644editdlrm
user.pyo17360644editdlrm
UserDict.py57780644editdlrm
UserDict.pyc88920644editdlrm
UserDict.pyo88920644editdlrm
UserList.py36440644editdlrm
UserList.pyc66030644editdlrm
UserList.pyo66030644editdlrm
UserString.py96910755editdlrm
UserString.pyc149220644editdlrm
UserString.pyo149220644editdlrm
uu.py59420755editdlrm
uu.pyc42370644editdlrm
uu.pyo42370644editdlrm
uuid.py209440644editdlrm
uuid.pyc212790644editdlrm
uuid.pyo212790644editdlrm
warnings.py141720644editdlrm
warnings.pyc130420644editdlrm
warnings.pyo122050644editdlrm
wave.py179520644editdlrm
wave.pyc194360644editdlrm
wave.pyo194360644editdlrm
weakref.py100870644editdlrm
weakref.pyc133750644editdlrm
weakref.pyo133750644editdlrm
webbrowser.py210730644editdlrm
webbrowser.pyc187550644editdlrm
webbrowser.pyo187080644editdlrm
whichdb.py33530644editdlrm
whichdb.pyc22470644editdlrm
whichdb.pyo22470644editdlrm
xdrlib.py55130644editdlrm
xdrlib.pyc91570644editdlrm
xdrlib.pyo91570644editdlrm
xmllib.py348650644editdlrm
xmllib.pyc272740644editdlrm
xmllib.pyo272740644editdlrm
xmlrpclib.py477750644editdlrm
xmlrpclib.pyc414960644editdlrm
xmlrpclib.pyo413130644editdlrm
zipfile.py530920644editdlrm
zipfile.pyc376520644editdlrm
zipfile.pyo376520644editdlrm
_abcoll.py142420644editdlrm
_abcoll.pyc215910644editdlrm
_abcoll.pyo215910644editdlrm
_LWPCookieJar.py65530644editdlrm
_LWPCookieJar.pyc56010644editdlrm
_LWPCookieJar.pyo56010644editdlrm
_MozillaCookieJar.py58090644editdlrm
_MozillaCookieJar.pyc45170644editdlrm
_MozillaCookieJar.pyo44760644editdlrm
_strptime.py197540644editdlrm
_strptime.pyc149660644editdlrm
_strptime.pyo149660644editdlrm
_threading_local.py71140644editdlrm
_threading_local.pyc63850644editdlrm
_threading_local.pyo63850644editdlrm
__future__.py43800644editdlrm
__future__.pyc42330644editdlrm
__future__.pyo42330644editdlrm
__phello__.foo.py640644editdlrm
__phello__.foo.pyc1250644editdlrm
__phello__.foo.pyo1250644editdlrm
Edit: /usr/lib64/python2.6/doctest.pyo (80706B)
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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/python2.6/doctest.pyR`s  cCsEti||t|do |`n|ip d|_ndS(NRht(R!ttruncateRHRhtbuf(Rjtsize((s/usr/lib64/python2.6/doctest.pyRms   N(R4t __module__R`R+Rm(((s/usr/lib64/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/lib64/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/lib64/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/lib64/python2.6/doctest.pyRNs  cCs@t|_|djotii}ntii||dS(N( RvRR+R=R?tf_backRRt set_trace(Rjtframe((s/usr/lib64/python2.6/doctest.pyRUs  cCs"|iotii|ndS(N(RRRt set_continue(Rj((s/usr/lib64/python2.6/doctest.pyR[s cGs=ti}|it_ztii||SWd|t_XdS(N(R=RRRRttrace_dispatch(Rjtargst save_stdout((s/usr/lib64/python2.6/doctest.pyRas   N(R4Rpt__doc__RR+RRR(((s/usr/lib64/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/lib64/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/lib64/python2.6/doctest.pyRs      N(R4RpRR+R(((s/usr/lib64/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/lib64/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/lib64/python2.6/doctest.pyt__repr__s  cCsXt|tpdSt|i|i|it|f|i|i|it|fS(Ni(R7RtcmpR'RNRtid(Rjtother((s/usr/lib64/python2.6/doctest.pyt__cmp__s!(R4RpRRRR(((s/usr/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/python2.6/doctest.pyRs@             N( R4RpRRtRRvRR+RuRRRR(((s/usr/lib64/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/lib64/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/lib64/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/lib64/python2.6/doctest.pytreport_successs cCs3||i|||ii|||idS(s7 Report that the given example failed. N(t_failure_headerRtoutput_differenceR(RjRRRRx((s/usr/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/python2.6/doctest.pyR!s,            cCsQ|ttBtB@ptS|t@otS|iddjo|iddjS(Ns i(RR R RtRvR(RjRwRxR((s/usr/lib64/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/lib64/python2.6/doctest.pyRs6        +(R4RpRR!RUR(((s/usr/lib64/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/lib64/python2.6/doctest.pyRQs  cCs t|iS(N(R8R(Rj((s/usr/lib64/python2.6/doctest.pyt__str__Vs(R4RpRRRc(((s/usr/lib64/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/lib64/python2.6/doctest.pyRds  cCs t|iS(N(R8R(Rj((s/usr/lib64/python2.6/doctest.pyRcis(R4RpRRRc(((s/usr/lib64/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/lib64/python2.6/doctest.pyRIscCst|||dS(N(R(RjRRRRa((s/usr/lib64/python2.6/doctest.pyRscCst|||dS(N(R(RjRRRRx((s/usr/lib64/python2.6/doctest.pyRsN(R4RpRR+RvRIRR(((s/usr/lib64/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/lib64/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/lib64/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/lib64/python2.6/doctest.pyREs     cCs.|i}|idj o|i|ndS(N(RRR+(RjR((s/usr/lib64/python2.6/doctest.pyROs cCs;|i}|idj o|i|n|iidS(N(RRR+R.RE(RjR((s/usr/lib64/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/lib64/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/lib64/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/lib64/python2.6/doctest.pyR s B cCs |iiS(N(RR'(Rj((s/usr/lib64/python2.6/doctest.pyRscCs4|iiid}d|ddi|d fS(NRs%s (%s)i(RR'RrR(RjR'((s/usr/lib64/python2.6/doctest.pyRscCsd|iiS(Ns Doctest: (RR'(Rj((s/usr/lib64/python2.6/doctest.pytshortDescriptionsN( R4RpR+RRRRRR RRRcR(((s/usr/lib64/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/lib64/python2.6/doctest.pyRs&%        t DocFileCasecBs)eZdZdZeZdZRS(cCsdi|iiidS(Nt_R(RRR'Rr(Rj((s/usr/lib64/python2.6/doctest.pyR scCs |iiS(N(RRN(Rj((s/usr/lib64/python2.6/doctest.pyR scCsd|ii|ii|fS(Ns2Failed doctest test for %s File "%s", line 0 %s(RR'RN(RjR((s/usr/lib64/python2.6/doctest.pyR s(R4RpRRRcR(((s/usr/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/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/lib64/python2.6/doctest.pyR) scCs|id|_|S(sosquare() -> square TestClass's associated value >>> _TestClass(13).square().get() 169 i(R(Rj((s/usr/lib64/python2.6/doctest.pytsquare3 scCs|iS(s}get() -> return TestClass's associated value. >>> x = _TestClass(-42) >>> print x.get() -42 (R(Rj((s/usr/lib64/python2.6/doctest.pyR*= s(R4RpRRRR*(((s/usr/lib64/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/lib64/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/lib64/python2.6/doctest.pyt.s  H0                 1 $ $5<)n  f    z? $=   I R  ,