nose2

0.16.0 · active · verified Sun Apr 12

nose2 is the successor to Nose, developed to extend Python's standard `unittest` module with a rich plugin ecosystem to ease the testing process. It acts as a popular test runner that automatically discovers and executes unit tests within a project. The current version is 0.16.0. It follows a 0.MAJOR.MINOR versioning scheme, where major releases introduce new functionality or breaking changes, and minor releases focus on bug fixes or small features.

Warnings

Install

Imports

Quickstart

Create a Python file (e.g., `test_math.py`) with test functions prefixed with `test_` or `unittest.TestCase` subclasses with `test_` methods. Then, simply navigate to your project directory in the terminal and run `nose2` to discover and execute tests.

import unittest

class MyTests(unittest.TestCase):
    def test_addition(self):
        self.assertEqual(1 + 1, 2)

def test_subtraction():
    assert 5 - 2 == 3

# Save this as `test_math.py`
# To run from the command line: `nose2`

view raw JSON →