{"name":"nose2: The Successor to nose, Based on unittest2","description":"nose2 is a powerful testing framework for Python, designed as the successor to the popular nose project. Built upon Python's standard `unittest` module, it extends its capabilities to provide a more flexible and feature-rich testing experience. It aims to make writing and running tests in Python simpler and more efficient.","github":"https://github.com/nose-devs/nose2","url":"https://osrepos.com/repo/nose-devs-nose2","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/nose-devs-nose2","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/nose-devs-nose2.md","json":"https://osrepos.com/repo/nose-devs-nose2.json","topics":["Python","Testing","Unit Testing","nose2","Testing Framework","Python Library","Software Development"],"keywords":["Python","Testing","Unit Testing","nose2","Testing Framework","Python Library","Software Development"],"stars":null,"summary":"nose2 is a powerful testing framework for Python, designed as the successor to the popular nose project. Built upon Python's standard `unittest` module, it extends its capabilities to provide a more flexible and feature-rich testing experience. It aims to make writing and running tests in Python simpler and more efficient.","content":"## Introduction\n\n**nose2** is a robust testing framework for Python, serving as the official successor to the widely-used `nose` project. Built directly on Python's standard `unittest` module, `nose2` extends its functionalities to offer a more flexible and feature-rich environment for writing and executing tests. Its primary goal is to simplify the testing process, making it more intuitive and powerful for Python developers. While `pytest` is a popular alternative for new projects, `nose2` provides a strong, `unittest`-based solution, especially for those familiar with or migrating from `nose`.\n\n## Installation\n\nGetting started with nose2 is straightforward. You can install it using pip:\n\nbash\npip install nose2\n\n\n## Examples\n\n`nose2` automatically discovers tests in Python files whose names start with `test_` and runs every test function it finds.\n\nHere's a basic example written in the standard `unittest` style:\n\npython\n# in test_simple.py\nimport unittest\n\nclass TestStrings(unittest.TestCase):\n    def test_upper(self):\n        self.assertEqual(\"spam\".upper(), \"SPAM\")\n\n\nYou can run this test from your terminal:\n\nbash\n$ nose2 -v\ntest_upper (test_simple.TestStrings) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n\n\n`nose2` also provides additional tools and features beyond what `unittest` offers. For instance, you can use decorators like `@params` to run a test with multiple sets of arguments:\n\npython\n# in test_fancy.py\nfrom nose2.tools import params\n\n@params(\"Sir Bedevere\", \"Miss Islington\", \"Duck\")\ndef test_is_knight(value):\n    assert value.startswith('Sir')\n\n\nRunning this with `nose2 -v --pretty-assert` demonstrates its enhanced output:\n\nbash\n$ nose2 -v --pretty-assert\ntest_fancy.test_is_knight:1\n'Sir Bedevere' ... ok\ntest_fancy.test_is_knight:2\n'Miss Islington' ... FAIL\ntest_fancy.test_is_knight:3\n'Duck' ... FAIL\n\n======================================================================\nFAIL: test_fancy.test_is_knight:2\n'Miss Islington'\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/mnt/ebs/home/sirosen/tmp/test_fancy.py\", line 6, in test_is_knight\n    assert value.startswith('Sir')\nAssertionError\n\n>>> assert value.startswith('Sir')\n\nvalues:\n    value = 'Miss Islington'\n    value.startswith = <built-in method startswith of str object at 0x7f3c3172f430>\n======================================================================\nFAIL: test_fancy.test_is_knight:3\n'Duck'\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/mnt/ebs/home/sirosen/tmp/test_fancy.py\", line 6, in test_is_knight\n    assert value.startswith('Sir')\nAssertionError\n\n>>> assert value.startswith('Sir')\n\nvalues:\n    value = 'Duck'\n    value.startswith = <built-in method startswith of str object at 0x7f3c3172d490>\n----------------------------------------------------------------------\nRan 3 tests in 0.001s\n\nFAILED (failures=2)\n\n\n## Why Use nose2?\n\n`nose2` offers several compelling reasons for Python developers:\n\n*   **`unittest` Foundation**: It builds upon the familiar `unittest` module, making it easy for developers already using `unittest` to transition and leverage `nose2`'s enhancements.\n*   **Enhanced Test Discovery**: Automatically finds and runs tests, reducing boilerplate configuration.\n*   **Extended Functionality**: Provides powerful tools and plugins, such as parameterized tests (`@params`) and improved assertion output (`--pretty-assert`), which go beyond standard `unittest` capabilities.\n*   **Successor to `nose`**: For projects migrating from the original `nose` framework, `nose2` offers a modern and maintained alternative, though with some differences to be aware of.\n*   **Active Development**: It supports current Python versions (Python 3) and aims to support PyPy and CPython betas.\n\n## Links\n\n*   **GitHub Repository**: [https://github.com/nose-devs/nose2](https://github.com/nose-devs/nose2){:target=\"_blank\"}\n*   **Official Documentation**: [https://docs.nose2.io/en/latest/](https://docs.nose2.io/en/latest/){:target=\"_blank\"}\n*   **PyPI Project Page**: [https://pypi.org/project/nose2/](https://pypi.org/project/nose2/){:target=\"_blank\"}\n*   **Mailing List**: [https://groups.google.com/a/nose2.io/forum/#!forum/discuss](https://groups.google.com/a/nose2.io/forum/#!forum/discuss){:target=\"_blank\"}\n*   **Contributing Guide**: [https://github.com/nose-devs/nose2/blob/main/contributing.rst](https://github.com/nose-devs/nose2/blob/main/contributing.rst){:target=\"_blank\"}\n*   **Differences from `nose`**: [https://docs.nose2.io/en/latest/differences.html](https://docs.nose2.io/en/latest/differences.html){:target=\"_blank\"}\n*   **Changelog**: [https://docs.nose2.io/en/latest/changelog.html](https://docs.nose2.io/en/latest/changelog.html){:target=\"_blank\"}","metrics":{"detailViews":0,"githubClicks":0},"dates":{"published":null,"modified":"2026-08-04T19:05:28.000Z"}}