-
Notifications
You must be signed in to change notification settings - Fork 122
Added unit tests for persistent history file #468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #468 +/- ##
=========================================
+ Coverage 89.84% 90.5% +0.65%
=========================================
Files 10 10
Lines 2758 2758
=========================================
+ Hits 2478 2496 +18
+ Misses 280 262 -18
Continue to review full report at Codecov.
|
…ent history file Also: - Switched to writing the file in the temp directory
tests/test_cmd2.py
Outdated
|
||
# Create path to a history file | ||
test_dir = os.path.dirname(request.module.__file__) | ||
hist_file = os.path.join(test_dir, 'hist_file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least on my system, either this or the next test exit with the file tests/hist_file still there.
@@ -1825,3 +1825,74 @@ def test_onecmd_raw_str_quit(base_app): | |||
assert stop | |||
assert out == '' | |||
|
|||
|
|||
@pytest.fixture(scope="session") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this fixture to help ensure that the history file always gets deleted no matter what
except FileNotFoundError: | ||
pass | ||
|
||
def test_existing_history_file(hist_file, capsys): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding some unit tests of this feature!
No description provided.