code: def test_policylive_forceuploads_on_finish(
      tempdir: Path, file_pusher: Mock
  ):
      elapsed = 0
      with patch.object(time, "time", lambda: elapsed):
          f = tempdir / "my-file.txt"
          write_with_mtime(f, b"content", mtime=0)
          policy = PolicyLive(str(f), f.name, file_pusher)
          policy.on_modified()
          file_pusher.reset_mock()
  
          elapsed += 1
          write_with_mtime(f, b"new content", mtime=elapsed)
          policy.on_modified()  # modifying the file shouldn't re-upload it because of the rate-limiting...
          file_pusher.file_changed.assert_not_called()
          policy.finish()  # ...but finish() should force a re-upload
          file_pusher.file_changed.assert_called()
  
imports: import os
  import tempfile
  import time
  from pathlib import Path
  from typing import TYPE_CHECKING, Callable
  from unittest.mock import Mock, patch
  import pytest
  import wandb.filesync.dir_watcher
  from wandb.filesync.dir_watcher import DirWatcher, PolicyEnd, PolicyLive, PolicyNow
  from wandb.sdk.internal.file_pusher import FilePusher
label_desc: Use image node_id 17 for calling a global function with example usage: test_policylive_forceuploads_on_finish(tempdir, file_pusher) without return types