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

Change tempdirs in test #657

Merged
merged 2 commits into from Feb 25, 2022
Merged

Change tempdirs in test #657

merged 2 commits into from Feb 25, 2022

Conversation

WenzDaniel
Copy link
Collaborator

What is the problem / what does the code in this PR do

Can you briefly describe how it works?
Change the tempdir creation of some of our tests. The new procedure uses a tempdir created by tempfile.TemporaryDirectory this method has a weak reference in its init which ensures that the directory gets deleted if its reference is garbage collected. In this way we can ensure permission denied erros etc. on shared systems like dali.

See also:

https://docs.python.org/3/library/tempfile.html#tempfile.TemporaryDirectory

and

https://stackoverflow.com/questions/50649701/shutil-rmtree-does-not-work-on-tempfile-temporarydirectory

Copy link
Member

@JoranAngevaare JoranAngevaare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, looks good

@coveralls
Copy link

coveralls commented Feb 25, 2022

Pull Request Test Coverage Report for Build 1897413521

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 89.061%

Totals Coverage Status
Change from base Build 1851339589: 0.06%
Covered Lines: 4657
Relevant Lines: 5229

💛 - Coveralls

@WenzDaniel WenzDaniel merged commit b6d5747 into master Feb 25, 2022
@WenzDaniel WenzDaniel deleted the change_tempdirs_in_test branch February 25, 2022 07:42
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.

None yet

3 participants