Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid another tempdir content assumption in test
test_init was using tempfile.gettempdir() directly to get the location where the hard-coded path repos/foo/bar.git would be used to test repository creation with relative and absolute paths. That reused the same location each time, and also assumed the directory would be usable, which could fail due to previous runs or due to the path being used separately from GitPython's tests. This commit fixes that by using that path inside a temporary directory, known at the start of the test to be empty. Reorganizing the acquision and cleanup logic also has had the effect of causing the test no longer to be skipped due to the logic in git.util.rmtree due to the final cleanup attempt (after all assertions). The directory is now successfully removed on Windows, and the test passes on all platforms.
- Loading branch information