[New-bugs-announce] [issue26878] Allow doctest to deep copy globals

DqASe report at bugs.python.org
Thu Apr 28 18:25:26 EDT 2016


New submission from DqASe:

Currently doctest makes shallow copies of the environment or globs argument.  This is somewhat un-symmetrical: on the one hand, a test cannot see variables created by another, but on the other, it can alter mutable objects.  This is inconvenient e.g. when documenting several methods that change an object (say, obj.append() , then obj.insert() - one would hope that the results are independent on the order tests are executed ).

An option to make deep copies of the variables in the context, instead of shallow ones, would in my opinion solve the issue cleanly.

----------
components: Library (Lib)
messages: 264452
nosy: DqASe
priority: normal
severity: normal
status: open
title: Allow doctest to deep copy globals
type: enhancement

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


More information about the New-bugs-announce mailing list