{ "info": { "author": "Brian Okken", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Testing" ], "description": "# pytest-check\n\nA pytest plugin that allows multiple failures per test.\n\n----\n\nThis [pytest](https://github.com/pytest-dev/pytest) plugin was a rewrite and a\nrename of [pytest-expect](https://github.com/okken/pytest-expect).\n\n\n\n## Installation\n\nFrom PPI:\n\n```\n$ pip install pytest-check\n```\n\nOr from github.\n\n```\n$ pip install git+https://github.com/okken/pytest-check\n```\n\n\n## Usage\n\nExample using import:\n\n```python\nimport pytest_check as check\n\n\ndef test_example():\n a = 1\n b = 2\n c = [2, 4, 6]\n check.greater(a, b)\n check.less_equal(b, a)\n check.is_in(a, c, \"Is 1 in the list\")\n check.is_not_in(b, c, \"make sure 2 isn't in list\")\n```\n\n\nTest results:\n\n```\n=================================== FAILURES ===================================\n_________________________________ test_example _________________________________\nFAILURE:\nassert 1 > 2\n test_check.py, line 14, in test_example() -> check.greater(a, b)\nFAILURE:\nassert 2 <= 1\n test_check.py, line 15, in test_example() -> check.less_equal(b, a)\nFAILURE: Is 1 in the list\nassert 1 in [2, 4, 6]\n test_check.py, line 16, in test_example() -> check.is_in(a, c, \"Is 1 in the list\")\nFAILURE: make sure 2 isn't in list\nassert 2 not in [2, 4, 6]\n test_check.py, line 17, in test_example() -> check.is_not_in(b, c, \"make sure 2 isn't in list\")\n------------------------------------------------------------\nFailed Checks: 4\n=========================== 1 failed in 0.11 seconds ===========================\n```\n\n\nExample using fixture:\n\n```python\ndef test_example(check):\n a = 1\n b = 2\n c = [2, 4, 6]\n check.greater(a, b)\n check.less_equal(b, a)\n check.is_in(a, c, \"Is 1 in the list\")\n check.is_not_in(b, c, \"make sure 2 isn't in list\")\n```\n\n\n## validation functions\n\n- **check.equal** - *a == b*\n- **check.not_equal** - *a != b*\n- **check.is_true** - *bool(x) is True*\n- **check.is_false** - *bool(x) is False*\n- **check.is_none** - *x is None*\n- **check.is_not_none** - *x is not None*\n- **check.is_in** - *a in b*\n- **check.is_not_in** - *a not in b*\n- **check.is_instance** - *isinstance(a, b)*\n- **check.not_is_instance** - *not isinstance(a, b)*\n- **check.almost_equal** - *a == pytest.approx(b, rel, abs)* see at: [pytest.approx](https://docs.pytest.org/en/latest/reference.html#pytest-approx)\n- **check.not_almost_equal** - *a != pytest.approx(b, rel, abs)* see at: [pytest.approx](https://docs.pytest.org/en/latest/reference.html#pytest-approx)\n- **check.greater** - *a > b*\n- **check.greater_equal** - *a >= b*\n- **check.less** - *a < b*\n- **check.less_equal** - *a <= b*\n\n## Defining your own check functions\n\nThe `@check_func` decorator allows you to wrap any test helper that has an assert\nstatement in it to be a non-blocking assert function.\n\n\n```python\nfrom pytest_check import check_func\n\n@check_func\ndef is_four(a):\n assert a == 4\n\ndef test_all_four():\n is_four(1)\n is_four(2)\n is_four(3)\n is_four(4)\n```\n\nThe above will result in:\n\n```\n...\n________________________________ test_all_four _________________________________\nFAILURE: assert 1 == 4\n test_fail.py, line 8, in test_all_four() -> is_four(1)\nFAILURE: assert 2 == 4\n test_fail.py, line 9, in test_all_four() -> is_four(2)\nFAILURE: assert 3 == 4\n test_fail.py, line 10, in test_all_four() -> is_four(3)\n------------------------------------------------------------\nFailed Checks: 3\n=========================== 1 failed in 0.12 seconds ===========================\n```\n\n## Using check as a context manager\n\nYou can use the `check()` context manager to wrap any assert that you want to continue after in a test.\n\n```python\nfrom pytest_check import check\n\n\ndef test_context_manager():\n with check:\n x = 3\n assert 1 < x < 4\n```\n\nWithin any `with check:`, however, you still won't get past the assert statement,\nso you will need to use multiple `with check:` blocks for multiple asserts:\n\n```python\n def test_multiple_failures():\n with check: assert 1 == 0\n with check: assert 1 > 2\n with check: assert 1 < 5 < 4\n\n```\n\n## Contributing\n\nContributions are very welcome. Tests can be run with [tox](https://tox.readthedocs.io/en/latest/). \nTest coverage is now 100%. Please make sure to keep it at 100%.\nIf you have an awesome pull request and need help with getting coverage back up, let me know.\n\n\n## License\n\nDistributed under the terms of the [MIT](http://opensource.org/licenses/MIT) license, \"pytest-check\" is free and open source software\n\n\n## Issues\n\nIf you encounter any problems, please [file an issue](https://github.com/okken/pytest-check/issues) along with a detailed description.\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/okken/pytest-check", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-check", "package_url": "https://pypi.org/project/pytest-check/", "platform": "", "project_url": "https://pypi.org/project/pytest-check/", "project_urls": { "Homepage": "https://github.com/okken/pytest-check" }, "release_url": "https://pypi.org/project/pytest-check/0.3.5/", "requires_dist": [ "pytest (>=3.1.1)" ], "requires_python": "", "summary": "A pytest plugin that allows multiple failures per test.", "version": "0.3.5" }, "last_serial": 5263163, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "201f8356953f4e0ebc9178aebec0f79f", "sha256": "535876d030c2664419822894214d1c2875aa2d1eb07317422f51875e2c75a8b2" }, "downloads": -1, "filename": "pytest_check-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "201f8356953f4e0ebc9178aebec0f79f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5129, "upload_time": "2017-10-30T05:35:37", "url": "https://files.pythonhosted.org/packages/7e/46/b65236fd7e58502904acecad4367216f21d87de6af30ba035ded737413f1/pytest_check-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "78a4291891728636d96d63df3e3501c0", "sha256": "6e83fe51cd0a3398aae772d484153d95fd501384971e5aff9e048566a8685122" }, "downloads": -1, "filename": "pytest-check-0.2.0.tar.gz", "has_sig": false, "md5_digest": "78a4291891728636d96d63df3e3501c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3312, "upload_time": "2017-10-30T05:35:39", "url": "https://files.pythonhosted.org/packages/3b/bd/fc28954419777616c9fc0c6726a90ddcff4c76cbdf5ab04c5f3e28801399/pytest-check-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "174c9ef309eac2cd28fd09fdc5c5ad8d", "sha256": "46d9649a72ce9e090e3e7f742ae9819ee2358cf8f4b0df8fd80c5997491533fd" }, "downloads": -1, "filename": "pytest_check-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "174c9ef309eac2cd28fd09fdc5c5ad8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5126, "upload_time": "2017-10-30T13:40:19", "url": "https://files.pythonhosted.org/packages/d7/c0/3e727ad075687e9097e1746c2b89a157f40db83c1e3475324ddc0d8d8885/pytest_check-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "21297eac5d350062aac1fc4eb1d081e5", "sha256": "b2ba789d96999835dacdf40b067fbb0b3e72d79cc6e60a6025397c700a72311a" }, "downloads": -1, "filename": "pytest-check-0.2.1.tar.gz", "has_sig": false, "md5_digest": "21297eac5d350062aac1fc4eb1d081e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3309, "upload_time": "2017-10-30T13:40:21", "url": "https://files.pythonhosted.org/packages/7a/09/fe75ae79dda6399617003d02c73211ea2d3c6c9078115554c1d415e3a5ce/pytest-check-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "98966917bb942f5c1fd7d043b95f4829", "sha256": "6dd5536cf7590e7aa6832dd424463b51e50816e56f6a8365dc7dd4d0686725ef" }, "downloads": -1, "filename": "pytest_check-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "98966917bb942f5c1fd7d043b95f4829", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5290, "upload_time": "2019-02-14T20:26:56", "url": "https://files.pythonhosted.org/packages/3b/df/19ff5f6a7d3d7d0a4905b246c1a05f82c71ef1ad28585a8194d56d9e0015/pytest_check-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bce9b588cdb3281d1b77d758bbe9e367", "sha256": "f4473c663cb92dd584582fcb0003587e7402d2f5c6756290f67a78f823be78bd" }, "downloads": -1, "filename": "pytest-check-0.3.0.tar.gz", "has_sig": false, "md5_digest": "bce9b588cdb3281d1b77d758bbe9e367", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4075, "upload_time": "2019-02-14T20:26:58", "url": "https://files.pythonhosted.org/packages/42/b4/7653dc0bf855ddadf6d6ef3a552571643df716061dd4b81ea95b957b4bfd/pytest-check-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "2f193e10fa3ad45e610e9722469cf5ab", "sha256": "d2f7314e1f58d5810c9b0bc80d5ae1a24de6d874355446e739b9d89594ecc9ee" }, "downloads": -1, "filename": "pytest_check-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2f193e10fa3ad45e610e9722469cf5ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5232, "upload_time": "2019-02-15T01:52:13", "url": "https://files.pythonhosted.org/packages/58/d6/f98ae107890ce2af110d6866a7d892828f4a50c1101ad9d3f639d6251fc9/pytest_check-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3c7a35d7efddb63fb49b3f1b488b689", "sha256": "47842861cbc873c2dafe85d35e4b56440cb34d22d769e3dd0f4622d59a4e1a51" }, "downloads": -1, "filename": "pytest-check-0.3.1.tar.gz", "has_sig": false, "md5_digest": "c3c7a35d7efddb63fb49b3f1b488b689", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4678, "upload_time": "2019-02-15T01:52:14", "url": "https://files.pythonhosted.org/packages/24/d7/f2c6226fa55aaea0b5f4617f5fcbd2061c8e83261587ee434f614d169e8f/pytest-check-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "5d4465c20ef158c0a1035e0f9a57854f", "sha256": "17e6fecf994c1dbba775297410c27ffe249a9fa342951863fe8fa9dce0d70d34" }, "downloads": -1, "filename": "pytest_check-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5d4465c20ef158c0a1035e0f9a57854f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5501, "upload_time": "2019-02-20T21:09:54", "url": "https://files.pythonhosted.org/packages/4a/e0/145c37932f7820ebdde49cb061ebcefd9595a1b05004effa5eca32082b51/pytest_check-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "273ee870630cda6a88eadf1618fcd516", "sha256": "f2d302084f23e6784c7e184b79570eeaad00cd066f58c1ae03820cca6fea799f" }, "downloads": -1, "filename": "pytest-check-0.3.2.tar.gz", "has_sig": false, "md5_digest": "273ee870630cda6a88eadf1618fcd516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5034, "upload_time": "2019-02-20T21:09:56", "url": "https://files.pythonhosted.org/packages/86/b6/a9cd594c1734d40dbe0d4a738824018dda8f6e9fe39db2df7aaa445c23e6/pytest-check-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "f52c148d7efcf51d589cb3df2a1a60fa", "sha256": "fc23ad5b571fd01e82217761aed2d64ffc678879ed4deb7c96954dbf9938ee45" }, "downloads": -1, "filename": "pytest_check-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "f52c148d7efcf51d589cb3df2a1a60fa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6855, "upload_time": "2019-02-23T21:54:17", "url": "https://files.pythonhosted.org/packages/d2/94/f40f20d65e6f43ae0af738fceb01f30d75eae50f9e3db754ab1eeca10d3a/pytest_check-0.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "53fc0d5309d4bfcb7c10700b4b26733e", "sha256": "df4cdb7505517af6a85e45baa8b545032cae9394c19f129bf8e66a7f2fb253ad" }, "downloads": -1, "filename": "pytest-check-0.3.3.tar.gz", "has_sig": false, "md5_digest": "53fc0d5309d4bfcb7c10700b4b26733e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5418, "upload_time": "2019-02-23T21:54:19", "url": "https://files.pythonhosted.org/packages/82/79/6500acd734f7ec38b3a956422a57929231dacd47e8c7337fdab7f4a33e61/pytest-check-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "85565b6122345396659703d086f22562", "sha256": "4a71b5b216a0a2f61c61e92f017d991263fd3846110dd634f0b399eb93d40038" }, "downloads": -1, "filename": "pytest_check-0.3.4-py3-none-any.whl", "has_sig": false, "md5_digest": "85565b6122345396659703d086f22562", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6924, "upload_time": "2019-02-24T04:31:35", "url": "https://files.pythonhosted.org/packages/96/1f/d77c34c512fc48a248786a18f23b10f7b6d9e6a89b0f5b37d8d1e2c3f34b/pytest_check-0.3.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1fcdb1ab1727577371a576b5aef496e2", "sha256": "4d40e5f3adaced40ad1000e1de62ccf75691fac6b7037548191933974dfa2542" }, "downloads": -1, "filename": "pytest-check-0.3.4.tar.gz", "has_sig": false, "md5_digest": "1fcdb1ab1727577371a576b5aef496e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5502, "upload_time": "2019-02-24T04:31:36", "url": "https://files.pythonhosted.org/packages/64/ba/8148a49782731b77dc7a8b62f928aa41a0cbea9d70884b0d4e33d4303394/pytest-check-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "8fa32987460cf5cea499cd1c8a3c05aa", "sha256": "74a8e17adeb5a37098cb500ce220561a1c5c2dd62a53d9ba4f58b9a3d5b5c772" }, "downloads": -1, "filename": "pytest_check-0.3.5-py3-none-any.whl", "has_sig": false, "md5_digest": "8fa32987460cf5cea499cd1c8a3c05aa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5864, "upload_time": "2019-05-13T15:54:23", "url": "https://files.pythonhosted.org/packages/9c/9f/7dc5645a4b7c1d4ad384e122c650779d785873bce6166bb0033c1372288d/pytest_check-0.3.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dae1b80e9e7e8bd7b07140379236dcc7", "sha256": "5c51678a049423353f5dd267e030268c1469c2a6552d51aa47aaf1c32054713c" }, "downloads": -1, "filename": "pytest-check-0.3.5.tar.gz", "has_sig": false, "md5_digest": "dae1b80e9e7e8bd7b07140379236dcc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5440, "upload_time": "2019-05-13T15:54:25", "url": "https://files.pythonhosted.org/packages/49/37/102c1735494cda6d27442ff1f6f296a87abf72fb3632bb7f4e3b6a015381/pytest-check-0.3.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8fa32987460cf5cea499cd1c8a3c05aa", "sha256": "74a8e17adeb5a37098cb500ce220561a1c5c2dd62a53d9ba4f58b9a3d5b5c772" }, "downloads": -1, "filename": "pytest_check-0.3.5-py3-none-any.whl", "has_sig": false, "md5_digest": "8fa32987460cf5cea499cd1c8a3c05aa", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5864, "upload_time": "2019-05-13T15:54:23", "url": "https://files.pythonhosted.org/packages/9c/9f/7dc5645a4b7c1d4ad384e122c650779d785873bce6166bb0033c1372288d/pytest_check-0.3.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dae1b80e9e7e8bd7b07140379236dcc7", "sha256": "5c51678a049423353f5dd267e030268c1469c2a6552d51aa47aaf1c32054713c" }, "downloads": -1, "filename": "pytest-check-0.3.5.tar.gz", "has_sig": false, "md5_digest": "dae1b80e9e7e8bd7b07140379236dcc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5440, "upload_time": "2019-05-13T15:54:25", "url": "https://files.pythonhosted.org/packages/49/37/102c1735494cda6d27442ff1f6f296a87abf72fb3632bb7f4e3b6a015381/pytest-check-0.3.5.tar.gz" } ] }