{ "info": { "author": "Jan Kaliszewski (zuo)", "author_email": "zuo@kaliszewski.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Software Development :: Testing" ], "description": "*unittest_expander* is a Python library that provides flexible and\neasy-to-use tools to parameterize your unit tests, especially those\nbased on *unittest.TestCase*.\n\nThe library is compatibile with Python 2.6, 2.7, 3.2, 3.3 and 3.4, and\ndoes not depend on external packages (uses only the Python standard\nlibrary).\n\n:Author: Jan Kaliszewski (zuo)\n:License: MIT License\n:Home Page: https://github.com/zuo/unittest_expander\n:Documentation: http://unittest-expander.readthedocs.org/\n\nInstalling\n----------\n\nThe easiest way to install the library is to execute (possibly in a\n`virtualenv`_) the command::\n\n pip install unittest_expander\n\n.. _virtualenv: https://virtualenv.pypa.io/en/latest/virtualenv.html\n\n(note that you need network access to do it this way; if you do not\nhave the *pip* tool installed -- see:\nhttps://pip.pypa.io/en/latest/installing.html).\n\nAlternatively, you can `download`_ the library source archive, unpack\nit, ``cd`` to the unpacked directory and execute the following\ncommand::\n\n python setup.py install\n\n.. _download: https://pypi.python.org/pypi/unittest_expander#downloads\n\n(you may need to have administrator privileges and/or network access,\nespecially if you are executing it *not* in a *virtualenv*).\n\nIt is also possible to use the library without installing it: as its\ncode is contained in a single file (``unittest_expander.py``), you can\njust copy it into your project.\n\n\nUsage example\n-------------\n\nConsider the following **ugly** test:\n\n.. code:: python\n\n import unittest\n\n class Test(unittest.TestCase):\n def test_sum(self):\n for iterable, expected in [\n ([], 0),\n ([0], 0),\n ([3], 3),\n ([1, 3, 1], 5),\n (set([1, 3]), 4),\n ({1:'a', 3:'b'}, 4),\n ]:\n self.assertEqual(sum(iterable), expected)\n\nIs it cool? **Not at all!** So let's improve it:\n\n.. code:: python\n\n import unittest\n from unittest_expander import expand, foreach\n\n @expand\n class Test(unittest.TestCase):\n @foreach(\n ([], 0),\n ([0], 0),\n ([3], 3),\n ([1, 3, 1], 5),\n (set([1, 3]), 4),\n ({1:'a', 3:'b'}, 4),\n )\n def test_sum(self, iterable, expected):\n self.assertEqual(sum(iterable), expected)\n\nNow you have **6 distinct tests** (properly *isolated* and being\nalways *reported as separate tests*), although they share the same\ntest method source.\n\nYou may want to do the same in a bit more verbose and descriptive\nway:\n\n.. code:: python\n\n import unittest\n from unittest_expander import expand, foreach, param\n\n @expand\n class Test(unittest.TestCase):\n\n test_sum_params = [\n param([], expected=0).label('empty gives 0'),\n param([0], expected=0),\n param([3], expected=3),\n param([1, 3, 1], expected=5),\n param(set([1, 3]), expected=4),\n param({1:'a', 3:'b'}, expected=4).label('even dict is ok'),\n ]\n\n @foreach(test_sum_params)\n def test_sum(self, iterable, expected):\n self.assertEqual(sum(iterable), expected)\n\nThis is only a fraction of the possibilities *unittest_expander*\noffers to you.\n\nYou can **learn more** from the actual `documentation of the module\n`_.", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zuo/unittest_expander", "keywords": "unittest testing parameterization parametrization", "license": null, "maintainer": null, "maintainer_email": null, "name": "unittest_expander", "package_url": "https://pypi.org/project/unittest_expander/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/unittest_expander/", "project_urls": { "Homepage": "https://github.com/zuo/unittest_expander" }, "release_url": "https://pypi.org/project/unittest_expander/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "Easy and flexible unittest parameterization.", "version": "0.3.1" }, "last_serial": 1194794, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "eb6308e3d85d380a81bf90f0163b166b", "sha256": "545b2884e737c93d45d97cd83bcd143ea69edb4edf72074391d555541f5e3a0c" }, "downloads": -1, "filename": "unittest_expander-0.1.0.tar.gz", "has_sig": false, "md5_digest": "eb6308e3d85d380a81bf90f0163b166b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29161, "upload_time": "2014-07-29T03:15:24", "url": "https://files.pythonhosted.org/packages/1f/9a/4fe11c3937cd5fb8a1079accfaec08d492f73f59d95016e44a1e3b303ce6/unittest_expander-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7f6476453d9de7864fd1634996488342", "sha256": "143799827591c99554ce0c046947ef31c1169ce1ba90b3860a684aea9846fce7" }, "downloads": -1, "filename": "unittest_expander-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7f6476453d9de7864fd1634996488342", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29212, "upload_time": "2014-07-29T12:18:42", "url": "https://files.pythonhosted.org/packages/60/49/b5c490d2eb2d3775f62cae3009090f31f41159562f7a884efc67834b7ec0/unittest_expander-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "7e908f950c308ee30fe5cd84b666358c", "sha256": "f254549b1e8b68dab3377112ab1cbc16ab05bad2fd9af95819537727b8d70427" }, "downloads": -1, "filename": "unittest_expander-0.1.2.tar.gz", "has_sig": false, "md5_digest": "7e908f950c308ee30fe5cd84b666358c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29670, "upload_time": "2014-07-31T23:31:20", "url": "https://files.pythonhosted.org/packages/9f/2d/5e9d50583ad1f72116195d9c01e9b10b76f0e01bb42b42d55fe8be28eb7b/unittest_expander-0.1.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ff9eccdaa451c3774612ac193f9d1405", "sha256": "e24b59efb0a2227c4a0d39b1185821f4a0beb56bb72e19c7cf9f57467aadcb45" }, "downloads": -1, "filename": "unittest_expander-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ff9eccdaa451c3774612ac193f9d1405", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30435, "upload_time": "2014-08-12T01:18:23", "url": "https://files.pythonhosted.org/packages/ba/80/57d973f8a427624d346aacf997945d7c414872940efde61d62b03ffc3d06/unittest_expander-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "c26567adb8723e260c89ffe1fbc16ce8", "sha256": "0cdc12a94d3c9b5801646edcfe63c17741edee1724376ff20ba14f04550cfd13" }, "downloads": -1, "filename": "unittest_expander-0.3.0.tar.gz", "has_sig": false, "md5_digest": "c26567adb8723e260c89ffe1fbc16ce8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31049, "upload_time": "2014-08-16T22:28:50", "url": "https://files.pythonhosted.org/packages/a8/20/a818135c7c33ef8b5289a7fdd47682c69ffe81e122223fc644802e377a10/unittest_expander-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "eb9688ca4d77e18f085b90a6c5ee26c2", "sha256": "34db2aaa60ad150d0d5546eabef8a2d8843b652fc3f85e4282fd4f8fb104f02d" }, "downloads": -1, "filename": "unittest_expander-0.3.1.tar.gz", "has_sig": false, "md5_digest": "eb9688ca4d77e18f085b90a6c5ee26c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31239, "upload_time": "2014-08-19T02:14:36", "url": "https://files.pythonhosted.org/packages/23/9c/1e57d8b2d683d75565b3759d46d71085d658e9f3ce468b01ad51ff43d58d/unittest_expander-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eb9688ca4d77e18f085b90a6c5ee26c2", "sha256": "34db2aaa60ad150d0d5546eabef8a2d8843b652fc3f85e4282fd4f8fb104f02d" }, "downloads": -1, "filename": "unittest_expander-0.3.1.tar.gz", "has_sig": false, "md5_digest": "eb9688ca4d77e18f085b90a6c5ee26c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31239, "upload_time": "2014-08-19T02:14:36", "url": "https://files.pythonhosted.org/packages/23/9c/1e57d8b2d683d75565b3759d46d71085d658e9f3ce468b01ad51ff43d58d/unittest_expander-0.3.1.tar.gz" } ] }