Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak
@with_rw_directory
and go back to using it
The situation with test_tree_modifier_ordering's helper, where it makes sense to wrap the helper itself with `@with_rw_directory` while still deleting the temporary directory as soon as the helper itself finishes, in order to make clear that the test itself does not use the temporary directory that the helper used, only occurs in one place in GitPython's tests as far as I know. In particular, all other places where `@with_rw_directory` was actually in use are test methods, not helper methods, and the way the decorator would have its wrapper log on failure documented the decorated method as a test. Mainly for that reason, I had backed away from using `@with_rw_directory` here. But the test code seems much easier to understand when it is used compared to other approaches. While it also has the disadvantage of doing a gc.collect that is unnecessary here, this is not the only place what that is done. This commit brings back the test_tree_modifier_ordering helper implementation that uses `@with_rw_directory`, while also modifying the logging logic in `@with_rw_directory` slightly, so that when the decorated method is not named as a test, it is referred to as a "Helper" rather than a "Test" in the failure log message.
- Loading branch information