code: def test_rebuild_on_edit(self, site_dir):
      started_building = threading.Event()
  
      with open(Path(site_dir, "test"), "wb") as f:
          time.sleep(0.01)
  
          with testing_server(site_dir, started_building.set) as server:
              server.watch(site_dir)
              time.sleep(0.01)
  
              f.write(b"hi\n")
              f.flush()
  
              self.assertTrue(started_building.wait(timeout=10))
  
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 5 for calling the BuildTests obj's underlying member method code with example usage: obj.test_rebuild_on_edit(site_dir) without return types