How can I clear/shadow globals before doctests are run? #8791
-
The default behaviour of Specific example: $ tree
.
└── test_package
└── foo
├── bar.py
└── __init__.py $ cat test_package/foo/bar.py
val = 42
class Bar:
def baz(self):
"""Use the quux.
Examples
--------
>>> val == 42
True
"""
return True
In the above doctest,
I want it to fail (with a How can I make the doctest fail, by effectively passing an empty dict to use as the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
its not effectively possible emptying the global name-space practically would break code using the classes same goes for using modified copies and potentially a number of other details this should first be experimented with in a plugin to figure how to make it sensible |
Beta Was this translation helpful? Give feedback.
its not effectively possible
emptying the global name-space practically would break code using the classes
same goes for using modified copies and potentially a number of other details
this should first be experimented with in a plugin to figure how to make it sensible