[Jython-checkins] jython: Removing doctests that don't seem relevant to Jython.

frank.wierzbicki jython-checkins at python.org
Thu Mar 22 21:06:11 CET 2012


http://hg.python.org/jython/rev/3508fea0face
changeset:   6479:3508fea0face
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Thu Mar 22 13:06:04 2012 -0700
summary:
  Removing doctests that don't seem relevant to Jython.
Have I mentioned that I don't like doctests?

files:
  Lib/test/test_generators.py |  38 -------------------------
  1 files changed, 0 insertions(+), 38 deletions(-)


diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -1619,11 +1619,6 @@
   ...
 ValueError: 7
 
->>> f().throw("abc")     # throw on just-opened generator
-Traceback (most recent call last):
-  ...
-abc
-
 Now let's try closing a generator:
 
 >>> def f():
@@ -1777,39 +1772,6 @@
 >>> leak()
 
 
-
-This test isn't really generator related, but rather exception-in-cleanup
-related. The coroutine tests (above) just happen to cause an exception in
-the generator's __del__ (tp_del) method. We can also test for this
-explicitly, without generators. We do have to redirect stderr to avoid
-printing warnings and to doublecheck that we actually tested what we wanted
-to test.
-
->>> import sys, StringIO
->>> from time import sleep
->>> old = sys.stderr
->>> try:
-...     sys.stderr = StringIO.StringIO()
-...     class Leaker:
-...         def __del__(self):
-...             raise RuntimeError
-...
-...     l = Leaker()
-...     del l; extra_collect()
-...     err = sys.stderr.getvalue().strip()
-...     err.startswith(
-...         "Exception RuntimeError in <"
-...     )
-...     err.endswith("> ignored")
-...     len(err.splitlines())
-... finally:
-...     sys.stderr = old
-True
-True
-1
-
-
-
 These refleak tests should perhaps be in a testfile of their own,
 test_generators just happened to be the test that drew these out.
 

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list