code: def test(ctx, unit=False, installed=False, style=False, cover=False):
      """run tests (unit, style)"""
  
      if not (unit or installed or style or cover):
          sys.exit("Test task needs --unit, --style or --cover")
  
      if unit:
          sys.exit(pytest_wrapper())
  
      if style:
          flake8_wrapper()  # exits on fail
          black_wrapper(False)  # always exits
  
      if installed:
          for p in list(sys.path):
              if p in ("", "."):
                  sys.path.remove(p)
              elif p == ROOT_DIR or p == os.path.dirname(ROOT_DIR):
                  sys.path.remove(p)
          os.environ["IMAGEIO_NO_INTERNET"] = "1"
          sys.exit(pytest_wrapper(needs_internet=False))
  
      if cover:
          res = pytest_wrapper(cov_report="html")
          if res:
              raise RuntimeError("Cannot show coverage, tests failed.")
          print("Launching browser.")
          fname = os.path.join(os.getcwd(), "htmlcov", "index.html")
          if not os.path.isfile(fname):
              raise IOError("Generated file not found: %s" % fname)
          webbrowser.open_new_tab(fname)
  
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 2 for calling a global function with example usage: test(ctx, unit, installed, style, cover) without return types