From 7644204d3d9589e02ce6f39c16caf2c75cd364df Mon Sep 17 00:00:00 2001 From: kotfu Date: Sat, 25 May 2019 13:58:25 -0600 Subject: Resolve PR feedback --- tests/test_history.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/test_history.py b/tests/test_history.py index 2fdd772f..3a52bda9 100644 --- a/tests/test_history.py +++ b/tests/test_history.py @@ -459,14 +459,11 @@ def hist_file(): pass def test_bad_history_file_path(capsys, request): - # Use a directory path as the history file - test_dir = os.path.dirname(request.module.__file__) - - # Create a new cmd2 app - cmd2.Cmd(persistent_history_file=test_dir) - _, err = capsys.readouterr() - - assert 'is a directory' in err + with tempfile.TemporaryDirectory() as test_dir: + # Create a new cmd2 app + cmd2.Cmd(persistent_history_file=test_dir) + _, err = capsys.readouterr() + assert 'is a directory' in err def test_history_file_conversion_no_truncate_on_init(hist_file, capsys): # test the code that converts a plain text history file to a pickle binary -- cgit v1.2.1