Skip to content

Fix tests that use temp dirs on Windows#669

Closed
inkychris wants to merge 7 commits intospf13:masterfrom
inkychris:windows-temp-dir-fix
Closed

Fix tests that use temp dirs on Windows#669
inkychris wants to merge 7 commits intospf13:masterfrom
inkychris:windows-temp-dir-fix

Conversation

@inkychris
Copy link
Contributor

@inkychris inkychris commented Mar 16, 2019

Fixes #668.

Tests added in #440 called os.Clearenv() which on windows causes os.TempDir() to default to C:\Windows and cause subsequent file permission failures. This has been repaced with os.Unsetenv() for the variables used in those tests.

The TestDirsSearch test was using path.Base() in its assertion which did not account for backslashes used on Windows. This has been replaced with filepath.Base() which correctly returns the expected value.

The initDirs() method now terminates a test if the temporary root test directory does not exist which should help debug tests that use it if os.Clearenv() gets used in future tests.

@inkychris
Copy link
Contributor Author

Implemented in #673

@inkychris inkychris closed this Mar 30, 2019
@inkychris inkychris deleted the windows-temp-dir-fix branch March 30, 2019 20:24
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.

1 participant