{ "info": { "author": "Nick Umble", "author_email": "privately.maintained@for.now", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: Freeware", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Software Development :: Testing" ], "description": "# softest - Soft Assertions\n\nSupports the soft assert style of testing, \nwhere multiple assertions can fail within the same method, \nwhile collecting and formatting those failures' stack traces \nfor reporting by a final `assert_all` call.\n\nSuch stack traces are enhanced \nto include the call hierarchy \nfrom within the test class.\n\n## Usage\n\n```python\nimport softest\n\n\nclass ExampleTest(softest.TestCase):\n\n\tdef test_example(self):\n\t\tself.soft_assert(self.assertEqual, 'Worf', 'wharf', 'Klingon is not ship receptacle')\n\t\tself.soft_assert(self.assertTrue, True)\n\t\tself.soft_assert(self.assertTrue, False)\n\n\t\tself.assert_all()\n\n\tdef test_example_with_only_one_failure(self):\n\t\tself.soft_assert(self.assertTrue, False)\n\t\tself.assert_all()\n\n\t# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----\n\tclass SomeException(Exception):\n\n\t\tdef __init__(self, reason:str):\n\t\t\tsuper().__init__(self)\n\t\t\tself.reason = reason\n\n\t\tdef __str__(self):\n\t\t\treturn self.reason\n\n\t# ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----\n\n\tdef test_assert_raises(self):\n\t\twith self.soft_assert_raises(self.SomeException) as assertion_context:\n\t\t\tprint('=)')\n\t\tprint(assertion_context)\n\n\t\twith self.soft_assert_raises_regex(self.SomeException, 'reason') as another_context:\n\t\t\traise self.SomeException('reazon')\n\t\tprint(another_context)\n\n\t\tself.assert_all()\n\n\nif __name__ == '__main__':\n\tsoftest.main()\n```\n\n\n### Error Console Output\n\n```\n======================================================================\nFAIL: \"test_assert_raises\" (ExampleTest)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\test\\softest_test.py\", line 41, in test_assert_raises\n self.assert_all()\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\main\\softest\\case.py\", line 140, in assert_all\n self.fail(''.join(failure_output))\nAssertionError: ++++ soft assert failure details follow below ++++\n\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\nThe following 2 failures were found in \"test_assert_raises\" (ExampleTest):\n+----------------------+----------------------+----------------------+\n Failure 1 (\"test_assert_raises\" method)\n+----------------------+----------------------+----------------------+\nTraceback (most recent call last):\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\test\\softest_test.py\", line 32, in test_assert_raises\n print('=)')\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\main\\softest\\context.py\", line 51, in __exit__\n \"Context actions did not raise {}\".format(exception_name))\n File \"C:\\Users\\nicholas.umble\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\unittest\\case.py\", line 135, in _raiseFailure\n raise self.test_case.failureException(msg)\nAssertionError: Context actions did not raise SomeException\n\n-+ [1/2] +-\n\n+----------------------+----------------------+----------------------+\n Failure 2 (\"test_assert_raises\" method)\n+----------------------+----------------------+----------------------+\nSomeException: reazon\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\test\\softest_test.py\", line 37, in test_assert_raises\n raise SomeException('reazon')\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\main\\softest\\context.py\", line 71, in __exit__\n self.expected_regex.pattern, str(exception_value)))\n File \"C:\\Users\\nicholas.umble\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\unittest\\case.py\", line 135, in _raiseFailure\n raise self.test_case.failureException(msg)\nAssertionError: \"reason\" does not match the supplied regular expression \"reazon\"\n\n-+ [2/2] +-\n\n======================================================================\nFAIL: \"test_example\" (ExampleTest)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\test\\softest_test.py\", line 24, in test_example\n self.assert_all()\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\main\\softest\\case.py\", line 140, in assert_all\n self.fail(''.join(failure_output))\nAssertionError: ++++ soft assert failure details follow below ++++\n\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\nThe following 2 failures were found in \"test_example\" (ExampleTest):\n+----------------------+----------------------+----------------------+\n Failure 1 (\"test_example\" method)\n+----------------------+----------------------+----------------------+\nTraceback (most recent call last):\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\test\\softest_test.py\", line 20, in test_example\n self.soft_assert(self.assertEqual, 'Worf', 'wharf', 'Klingon is not ship receptacle')\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\main\\softest\\case.py\", line 64, in soft_assert\n assert_method(*arguments, **keywords)\n File \"C:\\Users\\nicholas.umble\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\unittest\\case.py\", line 829, in assertEqual\n assertion_func(first, second, msg=msg)\n File \"C:\\Users\\nicholas.umble\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\unittest\\case.py\", line 1203, in assertMultiLineEqual\n self.fail(self._formatMessage(msg, standardMsg))\n File \"C:\\Users\\nicholas.umble\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\unittest\\case.py\", line 670, in fail\n raise self.failureException(msg)\nAssertionError: 'Worf' != 'wharf'\n- Worf\n+ wharf\n : Klingon is not ship receptacle\n\n-+ [1/2] +-\n\n+----------------------+----------------------+----------------------+\n Failure 2 (\"test_example\" method)\n+----------------------+----------------------+----------------------+\nTraceback (most recent call last):\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\test\\softest_test.py\", line 22, in test_example\n self.soft_assert(self.assertTrue, False)\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\main\\softest\\case.py\", line 64, in soft_assert\n assert_method(*arguments, **keywords)\n File \"C:\\Users\\nicholas.umble\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\unittest\\case.py\", line 682, in assertTrue\n raise self.failureException(msg)\nAssertionError: False is not true\n\n-+ [2/2] +-\n\n======================================================================\nFAIL: \"test_example_with_only_one_failure\" (ExampleTest)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\test\\softest_test.py\", line 28, in test_example_with_only_one_failure\n self.assert_all()\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\main\\softest\\case.py\", line 140, in assert_all\n self.fail(''.join(failure_output))\nAssertionError: ++++ soft assert failure details follow below ++++\n\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\nThe following failure was found in \"test_example_with_only_one_failure\" (ExampleTest):\n+----------------------+----------------------+----------------------+\nTraceback (most recent call last):\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\test\\softest_test.py\", line 27, in test_example_with_only_one_failure\n self.soft_assert(self.assertTrue, False)\n File \"C:\\more-programs\\automation\\workspaces\\Ivan\\Softest\\src\\main\\softest\\case.py\", line 64, in soft_assert\n assert_method(*arguments, **keywords)\n File \"C:\\Users\\nicholas.umble\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\unittest\\case.py\", line 682, in assertTrue\n raise self.failureException(msg)\nAssertionError: False is not true\n\n-+ [1/1] +-\n\n----------------------------------------------------------------------\nRan 3 tests in 0.016s\n\nFAILED (failures=3)\n```\n\n## Versions\n\n### 1.2.0.0\n\nAdded `soft_assert_raises` and `soft_assert_raises_regex` to support/replace `assertRaises` and `assertRaisesRegex`.\nUpdated output to include a failure count at the end of each failure, such as `-+ [1/2] +-`.\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": "http://privately.maintained.for.now", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "softest", "package_url": "https://pypi.org/project/softest/", "platform": "", "project_url": "https://pypi.org/project/softest/", "project_urls": { "Homepage": "http://privately.maintained.for.now" }, "release_url": "https://pypi.org/project/softest/1.2.0.0/", "requires_dist": null, "requires_python": "", "summary": "Supports lightweight soft assertions by extending the unittest.TestCase class", "version": "1.2.0.0" }, "last_serial": 4105604, "releases": { "1.0.0.1": [ { "comment_text": "", "digests": { "md5": "47990e9555fbe9bc1604f541468d59cd", "sha256": "69852ead7c3e8a16d595861240a694e0704587cd5e890f374edfdcc3310439c1" }, "downloads": -1, "filename": "softest-1.0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "47990e9555fbe9bc1604f541468d59cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3899, "upload_time": "2018-06-26T15:18:33", "url": "https://files.pythonhosted.org/packages/c9/c5/45922705c673401260d37dcdf94dc9d5a16a5e706b9e31e146ce01a51fdf/softest-1.0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a2a84e5b68d3d6f9f7bab86aabecce2c", "sha256": "9d316727a07d1b0dafd01083e850f0f0e61c774f454b2f99c41537bcda1c393b" }, "downloads": -1, "filename": "softest-1.0.0.1.tar.gz", "has_sig": false, "md5_digest": "a2a84e5b68d3d6f9f7bab86aabecce2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3047, "upload_time": "2018-06-26T15:18:34", "url": "https://files.pythonhosted.org/packages/75/71/a77f338eea138ff28a771c7e9b1c78d16402377fdf451c7f4fe5f596501b/softest-1.0.0.1.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "646a7c359b9797eea4ac2e3878e432da", "sha256": "61886336846ca04669a8de21585799b086876821d9c35b02ca8f4225197ff9d2" }, "downloads": -1, "filename": "softest-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "646a7c359b9797eea4ac2e3878e432da", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4467, "upload_time": "2018-07-03T15:09:10", "url": "https://files.pythonhosted.org/packages/f0/f4/16814e9f5a5dde2b917a2831d053a694ab0f8fe3be3ab2289dd7eac5f805/softest-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "03ecad43887718ef3ecef4563c55e884", "sha256": "9ddd925f8a9100de4c7692a606d4c5c6eb536106883fa6fed84f53c242b88133" }, "downloads": -1, "filename": "softest-1.0.1.tar.gz", "has_sig": false, "md5_digest": "03ecad43887718ef3ecef4563c55e884", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3767, "upload_time": "2018-07-03T15:09:11", "url": "https://files.pythonhosted.org/packages/72/99/673e14d41315e057c15b14f48c16d9035dba19ebf293ff74543667b31573/softest-1.0.1.tar.gz" } ], "1.0.1.1": [ { "comment_text": "", "digests": { "md5": "9245271b197f80a6f1041a16e25a4549", "sha256": "6d9cf0720dcc54c90f2ce458e9f23fb0784da7a6980313e18fff41eb4bf24499" }, "downloads": -1, "filename": "softest-1.0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9245271b197f80a6f1041a16e25a4549", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4486, "upload_time": "2018-07-03T15:41:33", "url": "https://files.pythonhosted.org/packages/2a/b9/37cb1980f567406dae8b3b043eb67115989b68201a6c1cebeaacda9c0809/softest-1.0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9fe04371e471c4357397d12d603506e3", "sha256": "36d2b04a0e5b8cd90d59ab09961ce3270334406ea481f159e488a394768d5d89" }, "downloads": -1, "filename": "softest-1.0.1.1.tar.gz", "has_sig": false, "md5_digest": "9fe04371e471c4357397d12d603506e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3778, "upload_time": "2018-07-03T15:41:35", "url": "https://files.pythonhosted.org/packages/86/5d/91605f903bf2e8fdf3ea9d2a47476ba28da21ca949fd0b4b33e5f26bf9bd/softest-1.0.1.1.tar.gz" } ], "1.2.0.0": [ { "comment_text": "", "digests": { "md5": "609fccab4dee067a2a57c71e6ff1d0ba", "sha256": "1a2960d1c3026f1ab9631fb8f9970847896f2c33bc68e8465465a8c2d47c28cb" }, "downloads": -1, "filename": "softest-1.2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "609fccab4dee067a2a57c71e6ff1d0ba", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7287, "upload_time": "2018-07-26T17:39:37", "url": "https://files.pythonhosted.org/packages/a4/f6/dca6271bd1610189ccdd34f2e039caf13739e2c9bf72c5237047e064e9ef/softest-1.2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ddef689933ebc4380ebaae4b90847a1a", "sha256": "68ba7a928748c0014cd159abf61b65f515ca1b42de0807d5baa2f3abe144d7fd" }, "downloads": -1, "filename": "softest-1.2.0.0.tar.gz", "has_sig": false, "md5_digest": "ddef689933ebc4380ebaae4b90847a1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6591, "upload_time": "2018-07-26T17:39:38", "url": "https://files.pythonhosted.org/packages/c0/56/9a2a97805a987540a4d7efafd8a1469fd279d12de7dcc05bf901b18a4dbb/softest-1.2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "609fccab4dee067a2a57c71e6ff1d0ba", "sha256": "1a2960d1c3026f1ab9631fb8f9970847896f2c33bc68e8465465a8c2d47c28cb" }, "downloads": -1, "filename": "softest-1.2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "609fccab4dee067a2a57c71e6ff1d0ba", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7287, "upload_time": "2018-07-26T17:39:37", "url": "https://files.pythonhosted.org/packages/a4/f6/dca6271bd1610189ccdd34f2e039caf13739e2c9bf72c5237047e064e9ef/softest-1.2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ddef689933ebc4380ebaae4b90847a1a", "sha256": "68ba7a928748c0014cd159abf61b65f515ca1b42de0807d5baa2f3abe144d7fd" }, "downloads": -1, "filename": "softest-1.2.0.0.tar.gz", "has_sig": false, "md5_digest": "ddef689933ebc4380ebaae4b90847a1a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6591, "upload_time": "2018-07-26T17:39:38", "url": "https://files.pythonhosted.org/packages/c0/56/9a2a97805a987540a4d7efafd8a1469fd279d12de7dcc05bf901b18a4dbb/softest-1.2.0.0.tar.gz" } ] }