##// END OF EJS Templates
add test history db to shell.tempfiles for cleanup...
MinRK -
Show More
@@ -2540,6 +2540,11 b' class InteractiveShell(SingletonConfigurable, Magic):'
2540 code that has the appropriate information, rather than trying to
2540 code that has the appropriate information, rather than trying to
2541 clutter
2541 clutter
2542 """
2542 """
2543 # Close the history session (this stores the end time and line count)
2544 # this must be *before* the tempfile cleanup, in case of temporary
2545 # history db
2546 self.history_manager.end_session()
2547
2543 # Cleanup all tempfiles left around
2548 # Cleanup all tempfiles left around
2544 for tfile in self.tempfiles:
2549 for tfile in self.tempfiles:
2545 try:
2550 try:
@@ -2547,9 +2552,6 b' class InteractiveShell(SingletonConfigurable, Magic):'
2547 except OSError:
2552 except OSError:
2548 pass
2553 pass
2549
2554
2550 # Close the history session (this stores the end time and line count)
2551 self.history_manager.end_session()
2552
2553 # Clear all user namespaces to release all references cleanly.
2555 # Clear all user namespaces to release all references cleanly.
2554 self.reset(new_session=False)
2556 self.reset(new_session=False)
2555
2557
@@ -194,6 +194,9 b' def start_ipython():'
194
194
195 # A few more tweaks needed for playing nicely with doctests...
195 # A few more tweaks needed for playing nicely with doctests...
196
196
197 # remove history file
198 shell.tempfiles.append(config.HistoryManager.hist_file)
199
197 # These traps are normally only active for interactive use, set them
200 # These traps are normally only active for interactive use, set them
198 # permanently since we'll be mocking interactive sessions.
201 # permanently since we'll be mocking interactive sessions.
199 shell.builtin_trap.activate()
202 shell.builtin_trap.activate()
@@ -171,7 +171,7 b' def default_config():'
171 config.TerminalInteractiveShell.colors = 'NoColor'
171 config.TerminalInteractiveShell.colors = 'NoColor'
172 config.TerminalTerminalInteractiveShell.term_title = False,
172 config.TerminalTerminalInteractiveShell.term_title = False,
173 config.TerminalInteractiveShell.autocall = 0
173 config.TerminalInteractiveShell.autocall = 0
174 config.HistoryManager.hist_file = os.path.join(tempfile.mkdtemp(), u'test_hist.sqlite')
174 config.HistoryManager.hist_file = tempfile.mktemp(u'test_hist.sqlite')
175 config.HistoryManager.db_cache_size = 10000
175 config.HistoryManager.db_cache_size = 10000
176 return config
176 return config
177
177
General Comments 0
You need to be logged in to leave comments. Login now