[pypy-svn] r12030 - pypy/dist/lib-python/modified-2.3.4/test
pedronis at codespeak.net
pedronis at codespeak.net
Fri May 6 19:19:27 CEST 2005
Author: pedronis
Date: Fri May 6 19:19:27 2005
New Revision: 12030
Added:
pypy/dist/lib-python/modified-2.3.4/test/test_descr.py
- copied, changed from r12022, pypy/dist/lib-python/2.3.4/test/test_descr.py
Log:
modified test_descr such that a failure doesn't kill it completely
Copied: pypy/dist/lib-python/modified-2.3.4/test/test_descr.py (from r12022, pypy/dist/lib-python/2.3.4/test/test_descr.py)
==============================================================================
--- pypy/dist/lib-python/2.3.4/test/test_descr.py (original)
+++ pypy/dist/lib-python/modified-2.3.4/test/test_descr.py Fri May 6 19:19:27 2005
@@ -3952,99 +3952,131 @@
except RuntimeError:
pass
+class NotRun(Exception):
+ pass
+
+def placeholder(func,msg):
+ def plh():
+ raise NotRun,"Not run: %s!" % msg
+ return plh
+
def test_main():
- weakref_segfault() # Must be first, somehow
- do_this_first()
- class_docstrings()
- lists()
- dicts()
- dict_constructor()
- test_dir()
- ints()
- longs()
- floats()
- complexes()
- spamlists()
- spamdicts()
- pydicts()
- pylists()
- metaclass()
- pymods()
- multi()
- mro_disagreement()
- diamond()
- ex5()
- monotonicity()
- consistency_with_epg()
- objects()
- slots()
- slotspecials()
- dynamics()
- errors()
- classmethods()
- classmethods_in_c()
- staticmethods()
- staticmethods_in_c()
- classic()
- compattr()
- newslot()
- altmro()
- overloading()
- methods()
- specials()
- weakrefs()
- properties()
- supers()
- inherits()
- keywords()
- restricted()
- str_subclass_as_dict_key()
- classic_comparisons()
- rich_comparisons()
- coercions()
- descrdoc()
- setclass()
- setdict()
- pickles()
- copies()
- binopoverride()
- subclasspropagation()
- buffer_inherit()
- str_of_str_subclass()
- kwdargs()
- delhook()
- hashinherit()
- strops()
- deepcopyrecursive()
- modules()
- dictproxyiterkeys()
- dictproxyitervalues()
- dictproxyiteritems()
- pickleslots()
- funnynew()
- imulbug()
- docdescriptor()
- string_exceptions()
- copy_setstate()
- slices()
- subtype_resurrection()
- slottrash()
- slotmultipleinheritance()
- testrmul()
- testipow()
- test_mutable_bases()
- test_mutable_bases_with_failing_mro()
- test_mutable_bases_catch_mro_conflict()
- mutable_names()
- subclass_right_op()
- dict_type_with_metaclass()
- meth_class_get()
- isinst_isclass()
- proxysuper()
- carloverre()
- filefault()
+ testfuncs = [
+ weakref_segfault, # Must be first, somehow
+ do_this_first,
+ class_docstrings,
+ lists,
+ dicts,
+ dict_constructor,
+ test_dir,
+ ints,
+ longs,
+ floats,
+ complexes,
+ spamlists,
+ spamdicts,
+ pydicts,
+ pylists,
+ metaclass,
+ pymods,
+ multi,
+ mro_disagreement,
+ diamond,
+ ex5,
+ monotonicity,
+ consistency_with_epg,
+ objects,
+ slots,
+ slotspecials,
+ dynamics,
+ errors,
+ classmethods,
+ classmethods_in_c,
+ staticmethods,
+ staticmethods_in_c,
+ classic,
+ compattr,
+ newslot,
+ altmro,
+ overloading,
+ methods,
+ specials,
+ weakrefs,
+ properties,
+ supers,
+ inherits,
+ keywords,
+ restricted,
+ str_subclass_as_dict_key,
+ classic_comparisons,
+ rich_comparisons,
+ coercions,
+ descrdoc,
+ setclass,
+ setdict,
+ pickles,
+ copies,
+ binopoverride,
+ subclasspropagation,
+ buffer_inherit,
+ str_of_str_subclass,
+ kwdargs,
+ delhook,
+ hashinherit,
+ placeholder(strops,"PyPy starts mem trashing with this one"),
+ deepcopyrecursive,
+ modules,
+ dictproxyiterkeys,
+ dictproxyitervalues,
+ dictproxyiteritems,
+ pickleslots,
+ funnynew,
+ imulbug,
+ docdescriptor,
+ string_exceptions,
+ copy_setstate,
+ slices,
+ subtype_resurrection,
+ slottrash,
+ slotmultipleinheritance,
+ testrmul,
+ testipow,
+ test_mutable_bases,
+ test_mutable_bases_with_failing_mro,
+ test_mutable_bases_catch_mro_conflict,
+ mutable_names,
+ subclass_right_op,
+ dict_type_with_metaclass,
+ meth_class_get,
+ isinst_isclass,
+ proxysuper,
+ carloverre,
+ filefault,]
+
+ #global verbose
+ #import test
+ #test.test_support.verbose = False
+ #verbose = False
+
+ n = len(testfuncs)
+ success = 0
+
+ for testfunc in testfuncs:
+ try:
+ print "*"*40
+ testfunc()
+ except Exception, e:
+ if isinstance(e, KeyboardInterrupt):
+ raise
+ print "-->", testfunc.__name__, "FAILURE(%d/%d)" % (success, n), str(e)
+ else:
+ success += 1
+ print "-->", testfunc.__name__, "OK(%d/%d)" % (success, n)
- if verbose: print "All OK"
+ if n != success:
+ raise TestFailed, "%d/%d" % (success, n)
+ else:
+ if verbose: print "All OK"
if __name__ == "__main__":
test_main()
More information about the Pypy-commit
mailing list