1Metadata-Version: 2.1 2Name: nose2 3Version: 0.10.0 4Summary: unittest2 with plugins, the succesor to nose 5Home-page: https://github.com/nose-devs/nose2 6Maintainer: nose2 devs 7Maintainer-email: dev@nose2.io 8License: UNKNOWN 9Description: .. image:: https://github.com/nose-devs/nose2/workflows/build/badge.svg?event=push 10 :alt: build status 11 :target: https://github.com/nose-devs/nose2/actions?query=workflow%3Abuild 12 13 .. image:: https://img.shields.io/pypi/v/nose2.svg 14 :target: https://pypi.org/project/nose2/ 15 :alt: Latest PyPI version 16 17 .. image:: https://img.shields.io/pypi/pyversions/nose2.svg 18 :alt: Supported Python Versions 19 :target: https://pypi.org/project/nose2/ 20 21 .. image:: https://img.shields.io/badge/Mailing%20list-discuss%40nose2.io-blue.svg 22 :target: https://groups.google.com/a/nose2.io/forum/#!forum/discuss 23 :alt: Join discuss@nose2.io 24 25 Welcome to nose2 26 ================ 27 28 ``nose2`` is the successor to ``nose``. 29 30 It's ``unittest`` with plugins. 31 32 ``nose2`` is a new project and does not support all of the features of 33 ``nose``. See `differences`_ for a thorough rundown. 34 35 nose2's purpose is to extend ``unittest`` to make testing nicer and easier to 36 understand. 37 38 nose2 vs pytest 39 --------------- 40 41 ``nose2`` may or may not be a good fit for your project. 42 43 If you are new to python testing, we encourage you to also consider `pytest`_, 44 a popular testing framework. 45 46 Quickstart 47 ---------- 48 49 Because ``nose2`` is based on unittest, you can start from the Python Standard 50 Library's `documentation for unittest <https://docs.python.org/library/unittest.html>`_ 51 and then use nose2 to add value on top of that. 52 53 ``nose2`` looks for tests in python files whose names start with ``test`` and 54 runs every test function it discovers. 55 56 Here's an example of a simple test, written in typical unittest style: 57 58 .. code-block:: python 59 60 # in test_simple.py 61 import unittest 62 63 class TestStrings(unittest.TestCase): 64 def test_upper(self): 65 self.assertEqual("spam".upper(), "SPAM") 66 67 You can then run this test like so:: 68 69 $ nose2 -v 70 test_upper (test_simple.TestStrings) ... ok 71 72 ---------------------------------------------------------------------- 73 Ran 1 test in 0.000s 74 75 OK 76 77 However, ``nose2`` supports more testing configuration and provides more tools 78 than ``unittest`` on its own. 79 80 For example, this test exercises just a few of ``nose2``'s features: 81 82 .. code-block:: python 83 84 # in test_fancy.py 85 from nose2.tools import params 86 87 @params("Sir Bedevere", "Miss Islington", "Duck") 88 def test_is_knight(value): 89 assert value.startswith('Sir') 90 91 and then run this like so:: 92 93 $ nose2 -v --pretty-assert 94 test_fancy.test_is_knight:1 95 'Sir Bedevere' ... ok 96 test_fancy.test_is_knight:2 97 'Miss Islington' ... FAIL 98 test_fancy.test_is_knight:3 99 'Duck' ... FAIL 100 101 ====================================================================== 102 FAIL: test_fancy.test_is_knight:2 103 'Miss Islington' 104 ---------------------------------------------------------------------- 105 Traceback (most recent call last): 106 File "/mnt/ebs/home/sirosen/tmp/test_fancy.py", line 6, in test_is_knight 107 assert value.startswith('Sir') 108 AssertionError 109 110 >>> assert value.startswith('Sir') 111 112 values: 113 value = 'Miss Islington' 114 value.startswith = <built-in method startswith of str object at 0x7f3c3172f430> 115 ====================================================================== 116 FAIL: test_fancy.test_is_knight:3 117 'Duck' 118 ---------------------------------------------------------------------- 119 Traceback (most recent call last): 120 File "/mnt/ebs/home/sirosen/tmp/test_fancy.py", line 6, in test_is_knight 121 assert value.startswith('Sir') 122 AssertionError 123 124 >>> assert value.startswith('Sir') 125 126 values: 127 value = 'Duck' 128 value.startswith = <built-in method startswith of str object at 0x7f3c3172d490> 129 ---------------------------------------------------------------------- 130 Ran 3 tests in 0.001s 131 132 FAILED (failures=2) 133 134 Full Docs 135 --------- 136 137 Full documentation for ``nose2`` is available at `docs.nose2.io`_ 138 139 Contributing 140 ------------ 141 142 If you want to make contributions, please read the `contributing`_ guide. 143 144 .. _differences: https://nose2.readthedocs.io/en/latest/differences.html 145 146 .. _pytest: http://pytest.readthedocs.io/en/latest/ 147 148 .. _contributing: https://github.com/nose-devs/nose2/blob/master/contributing.rst 149 150 .. _docs.nose2.io: https://docs.nose2.io/en/latest/ 151 152Keywords: unittest,testing,tests 153Platform: UNKNOWN 154Classifier: Development Status :: 4 - Beta 155Classifier: Environment :: Console 156Classifier: Intended Audience :: Developers 157Classifier: License :: OSI Approved :: BSD License 158Classifier: Programming Language :: Python 159Classifier: Programming Language :: Python :: 2.7 160Classifier: Programming Language :: Python :: 3.5 161Classifier: Programming Language :: Python :: 3.6 162Classifier: Programming Language :: Python :: 3.7 163Classifier: Programming Language :: Python :: 3.8 164Classifier: Programming Language :: Python :: 3.9 165Classifier: Programming Language :: Python :: Implementation :: CPython 166Classifier: Programming Language :: Python :: Implementation :: PyPy 167Classifier: Operating System :: OS Independent 168Classifier: Topic :: Software Development :: Libraries 169Classifier: Topic :: Software Development :: Libraries :: Python Modules 170Classifier: Topic :: Software Development :: Testing 171Provides-Extra: coverage_plugin 172Provides-Extra: dev 173