{"id":13469359,"url":"https://github.com/nose-devs/nose2","last_synced_at":"2025-05-13T19:10:21.453Z","repository":{"id":2043477,"uuid":"2980827","full_name":"nose-devs/nose2","owner":"nose-devs","description":"The successor to nose, based on unittest2","archived":false,"fork":false,"pushed_at":"2025-04-14T16:48:02.000Z","size":2339,"stargazers_count":803,"open_issues_count":40,"forks_count":131,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-04-27T04:54:49.058Z","etag":null,"topics":["library","nose","nose2","nosetest","nosetests","python","python-2","python-3","python-library","python2","python3","testing","testing-framework","testing-library","testing-tool","testing-tools","unit-test","unittest","unittesting"],"latest_commit_sha":null,"homepage":"https://nose2.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nose-devs.png","metadata":{"files":{"readme":"README.rst","changelog":"changelog.rst","contributing":"contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-12-14T15:33:15.000Z","updated_at":"2025-04-25T02:30:28.000Z","dependencies_parsed_at":"2024-02-19T18:26:41.402Z","dependency_job_id":"81990977-2696-4d3e-b5f0-9fefec5e7b23","html_url":"https://github.com/nose-devs/nose2","commit_stats":{"total_commits":995,"total_committers":84,"mean_commits":"11.845238095238095","dds":0.6844221105527638,"last_synced_commit":"7ff6809f491ea966ea629fc71511474d5dcedb0c"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nose-devs%2Fnose2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nose-devs%2Fnose2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nose-devs%2Fnose2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nose-devs%2Fnose2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nose-devs","download_url":"https://codeload.github.com/nose-devs/nose2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251089620,"owners_count":21534523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","nose","nose2","nosetest","nosetests","python","python-2","python-3","python-library","python2","python3","testing","testing-framework","testing-library","testing-tool","testing-tools","unit-test","unittest","unittesting"],"created_at":"2024-07-31T15:01:35.770Z","updated_at":"2025-04-27T04:54:55.195Z","avatar_url":"https://github.com/nose-devs.png","language":"Python","readme":".. image:: https://results.pre-commit.ci/badge/github/nose-devs/nose2/main.svg\n   :target: https://results.pre-commit.ci/latest/github/nose-devs/nose2/main\n   :alt: pre-commit.ci status\n\n.. image:: https://github.com/nose-devs/nose2/workflows/build/badge.svg?event=push\n    :alt: build status\n    :target: https://github.com/nose-devs/nose2/actions?query=workflow%3Abuild\n\n.. image:: https://readthedocs.org/projects/nose2/badge/\n    :target: https://nose2.io/\n    :alt: Documentation\n\n.. image:: https://img.shields.io/pypi/v/nose2.svg\n    :target: https://pypi.org/project/nose2/\n    :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/pyversions/nose2.svg\n    :alt: Supported Python Versions\n    :target: https://pypi.org/project/nose2/\n\n.. image:: https://img.shields.io/badge/Mailing%20list-discuss%40nose2.io-blue.svg\n    :target: https://groups.google.com/a/nose2.io/forum/#!forum/discuss\n    :alt: Join discuss@nose2.io\n\nWelcome to nose2\n================\n\nnose2's extends ``unittest`` to make testing nicer.\n\nnose2 vs nose\n-------------\n\n``nose2`` originated as the successor to ``nose``.\n\n``nose2`` is a distinct project and does not support all of the behaviors of ``nose``.\nSee `differences`_ for a thorough rundown.\n\nnose2 vs pytest\n---------------\n\n`pytest`_ is an excellent test framework and we encourage users to consider\nit for new projects.\n\nIt has a bigger team of maintainers and a larger community of users.\n\nQuickstart\n----------\n\nBecause ``nose2`` is based on unittest, you can start from the Python Standard\nLibrary's `documentation for unittest \u003chttps://docs.python.org/library/unittest.html\u003e`_\nand then use nose2 to add value on top of that.\n\n``nose2`` looks for tests in Python files whose names start with ``test`` and\nruns every test function it discovers.\n\nHere's an example of a simple test, written in typical unittest style:\n\n.. code-block:: python\n\n    # in test_simple.py\n    import unittest\n\n    class TestStrings(unittest.TestCase):\n        def test_upper(self):\n            self.assertEqual(\"spam\".upper(), \"SPAM\")\n\nYou can then run this test like so::\n\n    $ nose2 -v\n    test_upper (test_simple.TestStrings) ... ok\n\n    ----------------------------------------------------------------------\n    Ran 1 test in 0.000s\n\n    OK\n\nHowever, ``nose2`` supports more testing configuration and provides more tools\nthan ``unittest`` on its own.\n\nFor example, this test exercises just a few of ``nose2``'s features:\n\n.. code-block:: python\n\n    # in test_fancy.py\n    from nose2.tools import params\n\n    @params(\"Sir Bedevere\", \"Miss Islington\", \"Duck\")\n    def test_is_knight(value):\n        assert value.startswith('Sir')\n\nand then run this like so::\n\n    $ nose2 -v --pretty-assert\n    test_fancy.test_is_knight:1\n    'Sir Bedevere' ... ok\n    test_fancy.test_is_knight:2\n    'Miss Islington' ... FAIL\n    test_fancy.test_is_knight:3\n    'Duck' ... FAIL\n\n    ======================================================================\n    FAIL: test_fancy.test_is_knight:2\n    'Miss Islington'\n    ----------------------------------------------------------------------\n    Traceback (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')\n    AssertionError\n\n    \u003e\u003e\u003e assert value.startswith('Sir')\n\n    values:\n        value = 'Miss Islington'\n        value.startswith = \u003cbuilt-in method startswith of str object at 0x7f3c3172f430\u003e\n    ======================================================================\n    FAIL: test_fancy.test_is_knight:3\n    'Duck'\n    ----------------------------------------------------------------------\n    Traceback (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')\n    AssertionError\n\n    \u003e\u003e\u003e assert value.startswith('Sir')\n\n    values:\n        value = 'Duck'\n        value.startswith = \u003cbuilt-in method startswith of str object at 0x7f3c3172d490\u003e\n    ----------------------------------------------------------------------\n    Ran 3 tests in 0.001s\n\n    FAILED (failures=2)\n\nFull Docs\n---------\n\nFull documentation for ``nose2`` is available at `docs.nose2.io`_\n\nVersions and Support\n--------------------\n\nChangelog and Version Scheme\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nnose2 versions are numbered ``0.MAJOR.MINOR``. Minor releases contain bugfixes or\nsmaller features. Major features or backwards incompatible changes are done in\nmajor releases.\n\nFor a full description of all past versions and changes, see the `changelog`_.\n\nPython Versions\n~~~~~~~~~~~~~~~\n\nnose2 requires Python 3.\n\nIt supports all versions currently supported by the CPython team, and also aims\nto support PyPy and cpython betas.\n\nPython 2\n********\n\nPython 2 is no longer supported. The `0.12.x line of releases \u003cpy2line\u003e`_\ncontains the last versions which supported Python 2.\n\nUsers of Python 2 should understand that Python 2 is EOL and the Python 2\nsupport line for ``nose2`` is similarly considered EOL.\n\n.. note::\n\n    Fixes to 0.12.x may still be accepted on an as-needed basis for a short\n    while as the python3-only line of releases gets started.\n\nContributing\n------------\n\nIf you want to make contributions, please read the `contributing`_ guide.\n\n.. _py2line: https://github.com/nose-devs/nose2/tree/0.12.x-line\n\n.. _differences: https://docs.nose2.io/en/latest/differences.html\n\n.. _changelog: https://docs.nose2.io/en/latest/changelog.html\n\n.. _pytest: http://pytest.readthedocs.io/en/latest/\n\n.. _contributing: https://github.com/nose-devs/nose2/blob/main/contributing.rst\n\n.. _docs.nose2.io: https://docs.nose2.io/en/latest/\n","funding_links":[],"categories":["Testing","资源列表","测试","Python","Testing Tools","Testing [🔝](#readme)","Testing Frameworks","📚 فهرست","Awesome Python"],"sub_categories":["测试","تست و دیباگ","Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnose-devs%2Fnose2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnose-devs%2Fnose2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnose-devs%2Fnose2/lists"}