class_docstr: Nose test runner.
  
  This class is made available as numpy.testing.Tester, and a test function
  is typically added to a package's __init__.py like so::
  
    from numpy.testing import Tester
    test = Tester().test
  
  Calling this test function finds and runs all tests associated with the
  package and all its sub-packages.
  
  Attributes
  ----------
  package_path : str
      Full path to the package to test.
  package_name : str
      Name of the package to test.
  
  Parameters
  ----------
  package : module, str or None, optional
      The package to test. If a string, this should be the full path to
      the package. If None (default), `package` is set to the module from
      which `NoseTester` is initialized.
  raise_warnings : None, str or sequence of warnings, optional
      This specifies which warnings to configure as 'raise' instead
      of being shown once during the test execution.  Valid strings are:
  
        - "develop" : equals ``(Warning,)``
        - "release" : equals ``()``, don't raise on any warnings.
  
      Default is "release".
  depth : int, optional
      If `package` is None, then this can be used to initialize from the
      module of the caller of (the caller of (...)) the code that
      initializes `NoseTester`. Default of 0 means the module of the
      immediate caller; higher values are useful for utility routines that
      want to initialize `NoseTester` objects on behalf of other code.
class_docstr_tok: ["Nose","test","runner",".","This","class","is","made","available","as","numpy.testing.Tester",",","and","a","test","function","is","typically","added","to","a","package","'s","__init__.py","like","so",":",":","from","numpy.testing","import","Tester","test","=","Tester","(",")",".test","Calling","this","test","function","finds","and","runs","all","tests","associated","with","the","package","and","all","its","sub-packages",".","Attributes","--","--","--","--","--","package_path",":","str","Full","path","to","the","package","to","test",".","package_name",":","str","Name","of","the","package","to","test",".","Parameters","--","--","--","--","--","package",":","module",",","str","or","None",",","optional","The","package","to","test",".","If","a","string",",","this","should","be","the","full","path","to","the","package",".","If","None","(","default",")",",","`","package","`","is","set","to","the","module","from","which","`","NoseTester","`","is","initialized",".","raise_warnings",":","None",",","str","or","sequence","of","warnings",",","optional","This","specifies","which","warnings","to","configure","as","'raise","'","instead","of","being","shown","once","during","the","test","execution",".","Valid","strings","are",":","-","``","develop","''",":","equals","``","(","Warning",",",")","``","-","``","release","''",":","equals","``","(",")","``",",","do","n't","raise","on","any","warnings",".","Default","is","``","release","''",".","depth",":","int",",","optional","If","`","package","`","is","None",",","then","this","can","be","used","to","initialize","from","the","module","of","the","caller","of","(","the","caller","of","(","...",")",")","the","code","that","initializes","`","NoseTester","`",".","Default","of","0","means","the","module","of","the","immediate","caller",";","higher","values","are","useful","for","utility","routines","that","want","to","initialize","`","NoseTester","`","objects","on","behalf","of","other","code","."]
docstr: Run tests for module using nose.
  
  Parameters
  ----------
  label : {'fast', 'full', '', attribute identifier}, optional
      Identifies the tests to run. This can be a string to pass to
      the nosetests executable with the '-A' option, or one of several
      special values.  Special values are:
  
      * 'fast' - the default - which corresponds to the ``nosetests -A``
        option of 'not slow'.
      * 'full' - fast (as above) and slow tests as in the
        'no -A' option to nosetests - this is the same as ''.
      * None or '' - run all tests.
      * attribute_identifier - string passed directly to nosetests as '-A'.
  
  verbose : int, optional
      Verbosity value for test outputs, in the range 1-10. Default is 1.
  extra_argv : list, optional
      List with any extra arguments to pass to nosetests.
  doctests : bool, optional
      If True, run doctests in module. Default is False.
  coverage : bool, optional
      If True, report coverage of NumPy code. Default is False.
      (This requires the
      `coverage module <https://nedbatchelder.com/code/modules/coveragehtml>`_).
  raise_warnings : None, str or sequence of warnings, optional
      This specifies which warnings to configure as 'raise' instead
      of being shown once during the test execution. Valid strings are:
  
      * "develop" : equals ``(Warning,)``
      * "release" : equals ``()``, do not raise on any warnings.
  timer : bool or int, optional
      Timing of individual tests with ``nose-timer`` (which needs to be
      installed).  If True, time tests and report on all of them.
      If an integer (say ``N``), report timing results for ``N`` slowest
      tests.
  
  Returns
  -------
  result : object
      Returns the result of running the tests as a
      ``nose.result.TextTestResult`` object.
  
  Notes
  -----
  Each NumPy module exposes `test` in its namespace to run all tests for it.
  For example, to run all tests for numpy.lib:
  
  >>> np.lib.test() #doctest: +SKIP
  
  Examples
  --------
  >>> result = np.lib.test() #doctest: +SKIP
  Running unit tests for numpy.lib
  ...
  Ran 976 tests in 3.933s
  
  OK
  
  >>> result.errors #doctest: +SKIP
  []
  >>> result.knownfail #doctest: +SKIP
  []
docstr_tok: ["Run","tests","for","module","using","nose",".","Parameters","--","--","--","--","--","label",":","{","'fast","'",",","'full","'",",","``",",","attribute","identifier","}",",","optional","Identifies","the","tests","to","run",".","This","can","be","a","string","to","pass","to","the","nosetests","executable","with","the","'-A","'","option",",","or","one","of","several","special","values",".","Special","values","are",":","*","'fast","'","-","the","default","-","which","corresponds","to","the","``","nosetests","-A","``","option","of","'not","slow","'",".","*","'full","'","-","fast","(","as","above",")","and","slow","tests","as","in","the","'no","-A","'","option","to","nosetests","-","this","is","the","same","as","``",".","*","None","or","``","-","run","all","tests",".","*","attribute_identifier","-","string","passed","directly","to","nosetests","as","'-A","'",".","verbose",":","int",",","optional","Verbosity","value","for","test","outputs",",","in","the","range","1-10",".","Default","is","1.","extra_argv",":","list",",","optional","List","with","any","extra","arguments","to","pass","to","nosetests",".","doctests",":","bool",",","optional","If","True",",","run","doctests","in","module",".","Default","is","False",".","coverage",":","bool",",","optional","If","True",",","report","coverage","of","NumPy","code",".","Default","is","False",".","(","This","requires","the","`","coverage","module","<","https",":","\/\/nedbatchelder.com\/code\/modules\/coveragehtml",">","`","_",")",".","raise_warnings",":","None",",","str","or","sequence","of","warnings",",","optional","This","specifies","which","warnings","to","configure","as","'raise","'","instead","of","being","shown","once","during","the","test","execution",".","Valid","strings","are",":","*","``","develop","''",":","equals","``","(","Warning",",",")","``","*","``","release","''",":","equals","``","(",")","``",",","do","not","raise","on","any","warnings",".","timer",":","bool","or","int",",","optional","Timing","of","individual","tests","with","``","nose-timer","``","(","which","needs","to","be","installed",")",".","If","True",",","time","tests","and","report","on","all","of","them",".","If","an","integer","(","say","``","N","``",")",",","report","timing","results","for","``","N","``","slowest","tests",".","Returns","--","--","--","-","result",":","object","Returns","the","result","of","running","the","tests","as","a","``","nose.result.TextTestResult","``","object",".","Notes","--","--","-","Each","NumPy","module","exposes","`","test","`","in","its","namespace","to","run","all","tests","for","it",".","For","example",",","to","run","all","tests","for","numpy.lib",":",">",">",">","np.lib.test","(",")","#","doctest",":","+SKIP","Examples","--","--","--","--",">",">",">","result","=","np.lib.test","(",")","#","doctest",":","+SKIP","Running","unit","tests","for","numpy.lib","...","Ran","976","tests","in","3.933s","OK",">",">",">","result.errors","#","doctest",":","+SKIP","[","]",">",">",">","result.knownfail","#","doctest",":","+SKIP","[","]"]
code: def test(
      self,
      label="fast",
      verbose=1,
      extra_argv=None,
      doctests=False,
      coverage=False,
      raise_warnings=None,
      timer=False,
  ):
      """
      Run tests for module using nose.
  
      Parameters
      ----------
      label : {'fast', 'full', '', attribute identifier}, optional
          Identifies the tests to run. This can be a string to pass to
          the nosetests executable with the '-A' option, or one of several
          special values.  Special values are:
  
          * 'fast' - the default - which corresponds to the ``nosetests -A``
            option of 'not slow'.
          * 'full' - fast (as above) and slow tests as in the
            'no -A' option to nosetests - this is the same as ''.
          * None or '' - run all tests.
          * attribute_identifier - string passed directly to nosetests as '-A'.
  
      verbose : int, optional
          Verbosity value for test outputs, in the range 1-10. Default is 1.
      extra_argv : list, optional
          List with any extra arguments to pass to nosetests.
      doctests : bool, optional
          If True, run doctests in module. Default is False.
      coverage : bool, optional
          If True, report coverage of NumPy code. Default is False.
          (This requires the
          `coverage module <https://nedbatchelder.com/code/modules/coveragehtml>`_).
      raise_warnings : None, str or sequence of warnings, optional
          This specifies which warnings to configure as 'raise' instead
          of being shown once during the test execution. Valid strings are:
  
          * "develop" : equals ``(Warning,)``
          * "release" : equals ``()``, do not raise on any warnings.
      timer : bool or int, optional
          Timing of individual tests with ``nose-timer`` (which needs to be
          installed).  If True, time tests and report on all of them.
          If an integer (say ``N``), report timing results for ``N`` slowest
          tests.
  
      Returns
      -------
      result : object
          Returns the result of running the tests as a
          ``nose.result.TextTestResult`` object.
  
      Notes
      -----
      Each NumPy module exposes `test` in its namespace to run all tests for it.
      For example, to run all tests for numpy.lib:
  
      >>> np.lib.test() #doctest: +SKIP
  
      Examples
      --------
      >>> result = np.lib.test() #doctest: +SKIP
      Running unit tests for numpy.lib
      ...
      Ran 976 tests in 3.933s
  
      OK
  
      >>> result.errors #doctest: +SKIP
      []
      >>> result.knownfail #doctest: +SKIP
      []
      """
  
      # cap verbosity at 3 because nose becomes *very* verbose beyond that
      verbose = min(verbose, 3)
  
      from . import utils
  
      utils.verbose = verbose
  
      argv, plugins = self.prepare_test_args(
          label, verbose, extra_argv, doctests, coverage, timer
      )
  
      if doctests:
          print(
              "Running unit tests and doctests for %s"
              % self.package_name
          )
      else:
          print("Running unit tests for %s" % self.package_name)
  
      self._show_system_info()
  
      # reset doctest state on every run
      import doctest
  
      doctest.master = None
  
      if raise_warnings is None:
          raise_warnings = self.raise_warnings
  
      _warn_opts = dict(develop=(Warning,), release=())
      if isinstance(raise_warnings, basestring):
          raise_warnings = _warn_opts[raise_warnings]
  
      with suppress_warnings("location") as sup:
          # Reset the warning filters to the default state,
          # so that running the tests is more repeatable.
          warnings.resetwarnings()
          # Set all warnings to 'warn', this is because the default 'once'
          # has the bad property of possibly shadowing later warnings.
          warnings.filterwarnings("always")
          # Force the requested warnings to raise
          for warningtype in raise_warnings:
              warnings.filterwarnings("error", category=warningtype)
          # Filter out annoying import messages.
          sup.filter(message="Not importing directory")
          sup.filter(message="numpy.dtype size changed")
          sup.filter(message="numpy.ufunc size changed")
          sup.filter(category=np.ModuleDeprecationWarning)
          # Filter out boolean '-' deprecation messages. This allows
          # older versions of scipy to test without a flood of messages.
          sup.filter(message=".*boolean negative.*")
          sup.filter(message=".*boolean subtract.*")
          # Filter out distutils cpu warnings (could be localized to
          # distutils tests). ASV has problems with top level import,
          # so fetch module for suppression here.
          with warnings.catch_warnings():
              warnings.simplefilter("always")
              from ...distutils import cpuinfo
          sup.filter(category=UserWarning, module=cpuinfo)
          # See #7949: Filter out deprecation warnings due to the -3 flag to
          # python 2
          if sys.version_info.major == 2 and sys.py3kwarning:
              # This is very specific, so using the fragile module filter
              # is fine
              import threading
  
              sup.filter(
                  DeprecationWarning,
                  r"sys\.exc_clear\(\) not supported in 3\.x",
                  module=threading,
              )
              sup.filter(
                  DeprecationWarning, message=r"in 3\.x, __setslice__"
              )
              sup.filter(
                  DeprecationWarning, message=r"in 3\.x, __getslice__"
              )
              sup.filter(
                  DeprecationWarning,
                  message=r"buffer\(\) not supported in 3\.x",
              )
              sup.filter(
                  DeprecationWarning,
                  message=r"CObject type is not supported in 3\.x",
              )
              sup.filter(
                  DeprecationWarning,
                  message=r"comparing unequal types not supported in 3\.x",
              )
          # Filter out some deprecation warnings inside nose 1.3.7 when run
          # on python 3.5b2. See
          #     https://github.com/nose-devs/nose/issues/929
          # Note: it is hard to filter based on module for sup (lineno could
          #       be implemented).
          warnings.filterwarnings(
              "ignore",
              message=".*getargspec.*",
              category=DeprecationWarning,
              module=r"nose\.",
          )
  
          from .noseclasses import NumpyTestProgram
  
          t = NumpyTestProgram(argv=argv, exit=False, plugins=plugins)
  
      return t.result
  
file_path: catboost/contrib/python/numpy/py2/numpy/testing/_private/nosetester.py
imports: from __future__ import division, absolute_import, print_function
  import os
  import sys
  import warnings
  from numpy.compat import basestring
  import numpy
  from .utils import import_nose, suppress_warnings
label_desc: Use image node_id 6 for calling the NoseTester obj's underlying member method code with example usage: obj.test(label, verbose, extra_argv, doctests, coverage, raise_warnings, timer) and returns: t