##// END OF EJS Templates
Fix subtle bug in doctests (ipython namespace was being destroyed)....
Fernando Perez -
Show More
@@ -218,6 +218,7 b' class DocTestCase(doctests.DocTestCase):'
218 self._dt_optionflags = optionflags
218 self._dt_optionflags = optionflags
219 self._dt_checker = checker
219 self._dt_checker = checker
220 self._dt_test = test
220 self._dt_test = test
221 self._dt_test_globs_ori = test.globs
221 self._dt_setUp = setUp
222 self._dt_setUp = setUp
222 self._dt_tearDown = tearDown
223 self._dt_tearDown = tearDown
223
224
@@ -276,6 +277,12 b' class DocTestCase(doctests.DocTestCase):'
276 super(DocTestCase, self).setUp()
277 super(DocTestCase, self).setUp()
277
278
278 def tearDown(self):
279 def tearDown(self):
280
281 # Undo the test.globs reassignment we made, so that the parent class
282 # teardown doesn't destroy the ipython namespace
283 if isinstance(self._dt_test.examples[0],IPExample):
284 self._dt_test.globs = self._dt_test_globs_ori
285
279 # XXX - fperez: I am not sure if this is truly a bug in nose 0.11, but
286 # XXX - fperez: I am not sure if this is truly a bug in nose 0.11, but
280 # it does look like one to me: its tearDown method tries to run
287 # it does look like one to me: its tearDown method tries to run
281 #
288 #
General Comments 0
You need to be logged in to leave comments. Login now