[issue3462] test_builtin fails after test_decimal

Amaury Forgeot d'Arc report at bugs.python.org
Tue Jul 29 15:30:17 CEST 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Bingo! doctest sets the __builtins__._ variable,
and the last doctest in decimal.py (in lexicographic order) is
Decimal.__round__, which ends with
        >>> round(Decimal('sNaN123'), 0)
        Decimal('NaN123')
This is the value you see in Benjamin's output.

Here is a trivial patch:

Index: Lib/test/regrtest.py
===================================================================
--- Lib/test/regrtest.py        (revision 65283)
+++ Lib/test/regrtest.py        (working copy)
@@ -647,6 +647,8 @@
 def cleanup_test_droppings(testname, verbose):
     import shutil

+    __builtins__._ = None
+
     # Try to clean up junk commonly left behind.  While tests shouldn't
leave
     # any files or directories behind, when a test fails that can be
tedious
     # for it to arrange.  The consequences can be especially nasty on
Windows,

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3462>
_______________________________________


More information about the Python-bugs-list mailing list