code: def pytest_wrapper(cov_report="term", needs_internet=True):
      """Helper function to run tests."""
      import pytest
  
      # basic opts
      args = ["-v"]
      if not needs_internet:
          args += ["-m", "not needs_internet"]
  
      # coverage add-on
      args += [
          "--cov",
          "imageio",
          "--cov-config",
          ".coveragerc",
          "--cov-report",
          cov_report,
      ]
  
      # test location
      args += [os.path.join(ROOT_DIR, "tests")]
  
      return pytest.main(args)
  
file_path: imageio/tasks/test.py
imports: import os
  import sys
  import subprocess
  import webbrowser
  from invoke import task
  from ._config import ROOT_DIR
label_desc: Use image node_id 8 for calling a global function with example usage: pytest_wrapper(cov_report, needs_internet) and returns: pytest