Skip to content
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

Fix permission issues when tests are run on windows #462

Merged

Conversation

pyrco
Copy link
Contributor

@pyrco pyrco commented Nov 28, 2023

On Windows, files can not be opened when already open. This gives issues when using temporary files. By not deleting a temporaryfile after it is closed and closing it after it is created, this is circumvented.

By moving all these files into pytest's tmp_path, the tmp_path mechanism will take care of removing these temporary files.

@pyrco pyrco requested a review from Miauwkeru November 28, 2023 14:11
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (124896e) 73.88% compared to head (1b42460) 73.88%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #462   +/-   ##
=======================================
  Coverage   73.88%   73.88%           
=======================================
  Files         259      259           
  Lines       20901    20901           
=======================================
  Hits        15442    15442           
  Misses       5459     5459           
Flag Coverage Δ
unittests 73.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

On Windows, files can not be opened when already open. This gives issues
when using temporary files. By not deleting a temporaryfile after it is
closed and closing it after it is created, this is circumvented.

By moving all these files into pytest's tmp_path, the tmp_path mechanism
will take care of removing these temporary files.
@pyrco pyrco force-pushed the feature/dis-2010_fix-permission-issues-in-tests-on-windows branch from 7f21bd8 to 1b42460 Compare November 28, 2023 15:40
@pyrco pyrco requested a review from Miauwkeru November 28, 2023 15:40
@pyrco pyrco requested a review from Miauwkeru November 29, 2023 13:16
@pyrco pyrco merged commit 6f775ad into main Nov 30, 2023
@pyrco pyrco deleted the feature/dis-2010_fix-permission-issues-in-tests-on-windows branch November 30, 2023 07:50
JSCU-CNI pushed a commit to JSCU-CNI/dissect.target that referenced this pull request Jan 2, 2024
On Windows, files can not be opened when already open. This gives issues
when using temporary files. By not deleting a temporaryfile after it is
closed and closing it after it is created, this is circumvented.

By moving all these files into pytest's tmp_path, the tmp_path mechanism
will take care of removing these temporary files.
Poeloe pushed a commit that referenced this pull request Feb 29, 2024
On Windows, files can not be opened when already open. This gives issues
when using temporary files. By not deleting a temporaryfile after it is
closed and closing it after it is created, this is circumvented.

By moving all these files into pytest's tmp_path, the tmp_path mechanism
will take care of removing these temporary files.
Zawadidone pushed a commit to Zawadidone/dissect.target that referenced this pull request Apr 5, 2024
On Windows, files can not be opened when already open. This gives issues
when using temporary files. By not deleting a temporaryfile after it is
closed and closing it after it is created, this is circumvented.

By moving all these files into pytest's tmp_path, the tmp_path mechanism
will take care of removing these temporary files.
@Schamper Schamper mentioned this pull request Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants