code: def tests(session):
      session.install("pip", "--upgrade")
  
      # if we remove the --editable flag pytest throws an error, because there
      # are two copies of the pkg (src/ and site-packages/), this is a quick
      # way to fix it
      # https://github.com/pytest-dev/pytest/issues/7678
      session.install("--editable", ".")
  
      # test vanilla installation is importable
      session.run("python", "-c", "import sklearn_evaluation")
  
      # this is needed to run tests
      session.conda_install("lxml")
      # install other test dependencies
      session.install("--editable", ".[all]")
  
      # run unit tests
      # docstrings
      # pytest doctest docs: https://docs.pytest.org/en/latest/doctest.html
      # doctest docs: https://docs.python.org/3/library/doctest.html
      # and examples (this is a hacky way to do it since --doctest-modules will
      # first load any .py files, which are the examples, and then try to run
      # any doctests, there isn't any)
      session.run(
          "pytest",
          "tests/",
          "src/",
          "examples/",
          "--cov=sklearn_evaluation",
          "--doctest-modules",
      )
      session.run("coveralls")
  
      if session.python == "3.8" and platform.system() == "Linux":
          # build docs so we can detect build errors
          session.run("jupyter-book", "build", "docs/", external=True)
  
label_desc: Use image node_id 1 for calling a global function with example usage: tests(session) without return types