nose2

The successor to nose, based on unittest2.

Version

0.8.0

Runtime

Python Versions

Supported Languages

Python

Official Documentation

https://nose2.readthedocs.io/en/latest

YAML Configuration

nose2:

  • input:

    N/A

    Note: Inspecode does not support input: for nose2. If you want to configure test discovery for nose2, please specify the options in your configuration file.

  • auto-fix:

    N/A

  • config-file:

    Alias of -c option.

  • machine:

    • cpu:

      Amount of CPU. The default machine has 0.75 CPU with 2880 MiB RAM.

  • options:

    Below is the list of options that are supported:

    optional arguments:
      -s START_DIR, --start-dir START_DIR
                              Directory to start discovery ('.' default)
      -t TOP_LEVEL_DIRECTORY, --top-level-directory TOP_LEVEL_DIRECTORY, --project-directory TOP_LEVEL_DIRECTORY
                              Top level directory of project (defaults to start dir)
      --config [CONFIG], -c [CONFIG]
                              Config files to load, if they exist. ('unittest.cfg'
                              and 'nose2.cfg' in start directory default)
      --no-user-config      Do not load user config files
      --no-plugins          Do not load any plugins. Warning: nose2 does not do
                              anything if no plugins are loaded
      --plugin PLUGINS      Load this plugin module.
      --exclude-plugin EXCLUDE_PLUGINS
                              Do not load this plugin module
    
      plugin arguments:
      Command-line arguments added by plugins:
    
      -B, --output-buffer   Enable output buffer
      -F, --fail-fast       Stop the test run after the first error or failure
    
  • thresholds:

    • num-issues:

      No tool specific severity levels are available.

  • experimental:

    • incremental:

      N/A

      Note: The incremental analysis cannot be supported for nose2. This is because nose2 requires dependencies to run tests and the results on unchanged files can be affected by changed files.

YAML Examples

  • With default options:

    inspecode:
      nose2: default
    
  • With custom machine:

    inspecode:
      nose2:
        machine:
          cpu: 1.5 # 1.5 CPU, 5760 MiB RAM
    
  • With custom options:

    inspecode:
      nose2:
        options:
          --maxfail: 10
    
  • With a configuration file:

    inspecode:
      nose2:
        config-file: ./my-nose2.cfg
    

    The above configuration is equivalent to:

    inspecode:
      nose2:
        options:
          -c: ./my-nose2.cfg
    

Configuration File Detection

If no configuration files are specified via config-file or options field, Inspecode walks the file tree in lexical order in your repository to find the following configuration files and executes nose2 at the directory of each file found.

  • setup.py with test_suite parameter set to nose2.collector.collector
  • unittest.cfg
  • nose2.cfg

Note: Inspecode ignores specific configuration files while searching. See Configuration > Tool Configuration > Field: config-file for detail.

If the configuration files detected by Inspecode are not the ones you want to use or you do not want to use any configuration files, you can disable Inspecode from detecting configuration files by explicitly setting an empty string to config-file field like below:

inspecode:
  nose2:
    config-file: ""

Resolving Dependencies

The dependencies are resolved in the same manner as pytest. See the pytest page for the details.

results matching ""

    No results matching ""