code: def test_watches_through_symlinks(
      self, docs_dir, dir_to_link_to, tmp_dir
  ):
      try:
          Path(docs_dir, "link1.md").symlink_to(
              Path(tmp_dir, "file_dest_1.md")
          )
          Path(docs_dir, "linked_dir").symlink_to(
              dir_to_link_to, target_is_directory=True
          )
  
          Path(dir_to_link_to, "sublink.md").symlink_to(
              Path(tmp_dir, "file_dest_2.md")
          )
      except NotImplementedError:  # PyPy on Windows
          self.skipTest("Creating symlinks not supported")
  
      started_building = threading.Event()
  
      def wait_for_build():
          result = started_building.wait(timeout=10)
          started_building.clear()
          with self.assertLogs("mkdocs.livereload"):
              do_request(server, "GET /")
          return result
  
      with testing_server(docs_dir, started_building.set) as server:
          server.watch(docs_dir)
          time.sleep(0.01)
  
          Path(tmp_dir, "file_dest_1.md").write_text("edited")
          self.assertTrue(wait_for_build())
  
          Path(dir_to_link_to, "file_under.md").write_text("edited")
          self.assertTrue(wait_for_build())
  
          Path(tmp_dir, "file_dest_2.md").write_text("edited")
          self.assertTrue(wait_for_build())
  
          Path(docs_dir, "link1.md").unlink()
          self.assertTrue(wait_for_build())
  
          Path(tmp_dir, "file_dest_unused.md").write_text("edited")
          self.assertFalse(started_building.wait(timeout=0.5))
  
imports: import contextlib
  import email
  import io
  import sys
  import threading
  import time
  import unittest
  from pathlib import Path
  from unittest import mock
  from mkdocs.livereload import LiveReloadServer
  from mkdocs.tests.base import change_dir, tempdir
label_desc: Use image node_id 26 for calling the BuildTests obj's underlying member method code with example usage: obj.test_watches_through_symlinks(docs_dir, dir_to_link_to, tmp_dir) and returns: result