Opened 4 years ago

Last modified 4 years ago

## #24866 new defect

# run_doctests doesn't reset display manager appropriately

Reported by: | roed | Owned by: | |
---|---|---|---|

Priority: | minor | Milestone: | sage-8.2 |

Component: | doctest framework | Keywords: | |

Cc: | Merged in: | ||

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description

sage: run_doctests(sage.rings.ring) ... sage: True True --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-819d8d12aa16> in <module>() ----> 1 True /home/roed/sagedev/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in __call__(self, result) 244 self.start_displayhook() 245 self.write_output_prompt() --> 246 format_dict, md_dict = self.compute_format_data(result) 247 self.update_user_ns(result) 248 self.fill_exec_result(result) /home/roed/sagedev/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in compute_format_data(self, result) 148 149 """ --> 150 return self.shell.display_formatter.format(result) 151 152 # This can be set to True by the write_output_prompt method in a subclass /home/roed/sagedev/local/lib/python2.7/site-packages/sage/repl/display/formatter.pyc in format(self, obj, include, exclude) 200 """ 201 # First, use Sage rich output if there is any --> 202 sage_format, sage_metadata = self.dm.displayhook(obj) 203 assert PLAIN_TEXT in sage_format, 'plain text is always present' 204 if not set(sage_format.keys()).issubset(self.default_mime()): TypeError: 'NoneType' object is not iterable

**Note:**See TracTickets for help on using tickets.

The problem is that

`init_sage`

in`sage.doctest.forker`

makes changes that aren't reset in the`finally`

block of`run_doctests`

.