code: def test(label="full", extra_arg_string="", coverage=False):
      """Test vispy software
  
      Parameters
      ----------
      label : str
          Can be one of 'full', 'unit', 'nobackend', 'extra', 'lineendings',
          'flake', 'docs', or any backend name (e.g., 'qt').
      extra_arg_string : str | list of str
          Extra arguments to sent to ``pytest``.
          Can also be a list of str to more explicitly provide the
          arguments.
      coverage : bool
          If True, collect coverage data.
      """
      if label == "osmesa":
          # Special case for OSMesa, we have to modify the VISPY_GL_LIB envvar
          # before the vispy.gloo package gets imported
          from ..util.osmesa_gl import fix_osmesa_gl_lib
  
          fix_osmesa_gl_lib()
  
      from ..app.backends import BACKEND_NAMES as backend_names
  
      label = label.lower()
      label = "pytest" if label == "nose" else label
      known_types = [
          "full",
          "unit",
          "lineendings",
          "extra",
          "flake",
          "docs",
          "nobackend",
          "examples",
      ]
  
      if label not in known_types + backend_names:
          raise ValueError(
              "label must be one of %s, or a backend name %s, "
              "not '%s'" % (known_types, backend_names, label)
          )
      # remove troublesome backends
      # see https://github.com/vispy/vispy/issues/2009
      backend_names.remove("tkinter")
  
      # figure out what we actually need to run
      runs = []
      if label in ("full", "unit"):
          for backend in backend_names:
              runs.append(
                  [
                      partial(
                          _unit, backend, extra_arg_string, coverage
                      ),
                      backend,
                  ]
              )
      elif label in backend_names:
          runs.append(
              [partial(_unit, label, extra_arg_string, coverage), label]
          )
  
      if label in ("full", "unit", "nobackend"):
          runs.append(
              [
                  partial(
                      _unit, "nobackend", extra_arg_string, coverage
                  ),
                  "nobackend",
              ]
          )
  
      if label == "examples":
          # take the extra arguments so that specific examples can be run
          runs.append(
              [partial(_examples, extra_arg_string), "examples"]
          )
      elif label == "full":
          # run all the examples
          runs.append([partial(_examples, ""), "examples"])
  
      if label in ("full", "extra", "lineendings"):
          runs.append([_check_line_endings, "lineendings"])
      if label in ("full", "extra", "flake"):
          runs.append([_flake, "flake"])
      if label in ("extra", "docs"):
          runs.append([_docs, "docs"])
  
      t0 = time()
      fail = []
      skip = []
      for run in runs:
          try:
              run[0]()
          except RuntimeError as exp:
              print("Failed: %s" % str(exp))
              fail += [run[1]]
          except VispySkipSuite:
              skip += [run[1]]
          except Exception as exp:
              # this should only happen if we've screwed up the test setup
              fail += [run[1]]
              print(
                  "Failed strangely (%s): %s\n" % (type(exp), str(exp))
              )
              import traceback
  
              type_, value, tb = sys.exc_info()
              traceback.print_exception(type_, value, tb)
          else:
              print("Passed\n")
          sys.stdout.flush()
      dt = time() - t0
      stat = "%s failed, %s skipped" % (
          fail if fail else 0,
          skip if skip else 0,
      )
      extra = "failed" if fail else "succeeded"
      print("Testing %s (%s) in %0.3f seconds" % (extra, stat, dt))
      sys.stdout.flush()
      if len(fail) > 0:
          raise RuntimeError("FAILURE")
  
imports: from __future__ import print_function
  import sys
  import os
  import warnings
  from os import path
  from copy import deepcopy
  from functools import partial
  from ..util import use_log_level, run_subprocess
  from ..util.ptime import time
  from ._testing import has_application, nottest, IS_CI, IS_TRAVIS_CI
label_desc: Use image node_id 8 for calling a global function with example usage: test(label, extra_arg_string, coverage) without return types