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

Create tempdir in test using t.TempDir() #4851

Merged
merged 3 commits into from
May 21, 2024
Merged

Conversation

Jacalz
Copy link
Member

@Jacalz Jacalz commented May 18, 2024

Description:

Go 1.18 introduced the .TempDir() method for automatically creating temporary directories in tests that then are removed automatically at the end of the tests. use that instead of the functions in the os package.

This change initially introduced errors that then turned out to be cases of actual bugs where we did not close file handles.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@coveralls
Copy link

coveralls commented May 18, 2024

Coverage Status

coverage: 65.087% (-0.008%) from 65.095%
when pulling e15f766 on Jacalz:use-t-tempdir
into 4fa888a on fyne-io:develop.

@Jacalz
Copy link
Member Author

Jacalz commented May 18, 2024

Sigh. Windows… It might just be a case of some readers not being closed but of course you’ll have to fal the whole test for that. I’ll have a look tomorrow

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

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

Oh that is so cool - nice to see testing has this feature!

@Jacalz Jacalz merged commit edb9b28 into fyne-io:develop May 21, 2024
12 checks passed
@Jacalz Jacalz deleted the use-t-tempdir branch May 21, 2024 09:50
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