Commit 9277ff5
committed
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.1 parent ad570de commit 9277ff5
1 file changed
+7
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
521 | 519 | | |
522 | 520 | | |
523 | 521 | | |
| |||
527 | 525 | | |
528 | 526 | | |
529 | 527 | | |
530 | | - | |
| 528 | + | |
531 | 529 | | |
532 | 530 | | |
533 | 531 | | |
| |||
562 | 560 | | |
563 | 561 | | |
564 | 562 | | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | 563 | | |
573 | 564 | | |
574 | 565 | | |
| |||
0 commit comments