-
Notifications
You must be signed in to change notification settings - Fork 14
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
create temp dir and use it for session dir in tests #335
Conversation
To avoid delete a session file that this repository created in CI.
@@ -48,6 +51,7 @@ def setUp(self): | |||
|
|||
def tearDown(self): | |||
clean_session_files() | |||
del os.environ[SESSION_DIR_KEY] |
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.
With tempfile.mkdtemp
, you need to clean up the temp directory manually https://stackoverflow.com/questions/6884991/how-to-delete-a-directory-created-with-tempfile-mkdtemp/55871731
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 fixed it
c844dbc
to
340de21
Compare
340de21
to
e2e8481
Compare
Kudos, SonarCloud Quality Gate passed!
|
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.
LGTM. Kudos for your python 3.6 workaround 👍
if: matrix.python-version == '3.6' | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv==2021.11.5 |
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.
A session file that was created in this repo's CI was deleted by tests (by clean_test_session_files method)
Then, two test sessions were created 1) subset command, 2) record test command but it's not intented.
So I create a temp dir and use it in test to avoid deleting a session file that this repository created in CI.