Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use NamedTemporaryFile in hist_file_config test

  • Loading branch information...
commit 088742ba9cc3099fa80fdf4004152893c9e9005f 1 parent af429a3
@minrk authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 IPython/core/tests/test_history.py
View
10 IPython/core/tests/test_history.py
@@ -128,7 +128,11 @@ def test_timestamp_type():
def test_hist_file_config():
cfg = Config()
- cfg.HistoryManager.hist_file = tempfile.mktemp()
- hm = HistoryManager(shell=get_ipython(), config=cfg)
- nt.assert_equals(hm.hist_file, cfg.HistoryManager.hist_file)
+ tfile = tempfile.NamedTemporaryFile(delete=False)
+ cfg.HistoryManager.hist_file = tfile.name
+ try:
+ hm = HistoryManager(shell=get_ipython(), config=cfg)
+ nt.assert_equals(hm.hist_file, cfg.HistoryManager.hist_file)
+ finally:
+ os.remove(tfile.name)
Please sign in to comment.
Something went wrong with that request. Please try again.