def test_successful_refresh_with_same_env_invalidates_cached_version_info(self):
        """Changing git at the same path/command and refreshing affects version_info."""
        with contextlib.ExitStack() as stack:
            stack.enter_context(_rollback_refresh())
            path1 = stack.enter_context(_fake_git(11, 111, 1))
            path2 = stack.enter_context(_fake_git(22, 222, 2))
            with mock.patch.dict(os.environ, {"GIT_PYTHON_GIT_EXECUTABLE": path1}):
                new_git = Git()
                refresh()
                new_git.version_info
                shutil.copy(path2, path1)
                refresh()  # The fake git at path1 has a different version now.
                self.assertEqual(new_git.version_info, (22, 222, 2))
Changing git at the same path/command and refreshing affects version_info.
test/test_git.py