summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2019-05-25 13:58:25 -0600
committerkotfu <kotfu@kotfu.net>2019-05-25 13:58:25 -0600
commit7644204d3d9589e02ce6f39c16caf2c75cd364df (patch)
tree2c57b17975012dc7f6ec5e81384cf31d69df3f9a /tests
parent76b29031e0725f3dc2244b2c4a1429386505655b (diff)
downloadcmd2-git-7644204d3d9589e02ce6f39c16caf2c75cd364df.tar.gz
Resolve PR feedback
Diffstat (limited to 'tests')
-rw-r--r--tests/test_history.py13
1 files changed, 5 insertions, 8 deletions
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