message: feat: rewrite test_stubs to call stubtest directly
diff: -import mypy.stubtest
  -import subprocess
  -import sys
  -import tempfile
  -import contextlib
  import os
  -from typing import *
  -
  +import mypy.stubtest
  MYPY_INI_PATH = os.path.join(os.path.dirname(__file__), 'mypy.ini')
  +
  def test_stubs():
  # The test has false positives on the following keywords
  skip_stubs_errors = ['pybind11_module_local', 'git_revision', '(checked 1 module)']
  # just run stubtest
  - stubs = subprocess.run([
  - sys.executable, '-m', 'mypy.stubtest',
  - 'duckdb',
  - '--mypy-config-file', MYPY_INI_PATH,
  - ], stdout=subprocess.PIPE)
  - if (stubs.returncode != 0):
  - errors = stubs.stdout.decode('utf-8').split('error')
  - broken_stubs = []
  - for error in errors:
  - add_error = True
  - for skip in skip_stubs_errors:
  - if error == '' or skip in error:
  - add_error = False
  - break
  - if (add_error):
  - broken_stubs.append(error)
  - if len(broken_stubs) > 0:
  +
  + errors = mypy.stubtest.test_module('duckdb')
  +
  + broken_stubs = [
  + error
  + for error in errors
  + if not any(skip in error for skip in skip_stubs_errors)
  + ]
  +
  + if broken_stubs:
  print("Stubs must be updated, either add them to skip_stubs_errors or update __init__.pyi accordingly")
  print(broken_stubs)
  - assert(0)
  \ No newline at end of file
  + assert broken_stubs == []
  