{ "info": { "author": "Facundo Batista", "author_email": "facundo@taniquetil.com.ar", "bugtrack_url": null, "classifiers": [], "description": "Log Assertion\n=============\n\n\nWhat?\n-----\n\nA simple log assertion mechanism for Python unittests.\n\n\nWhy?\n----\n\nAs is vox populi, you must also test the logging calls in your programs.\n\nWith ``logassert`` this is now very easy.\n\n\nAwesome! How to use it?\n-----------------------\n\nAll you need to do is to call this module's ``setup()`` passing the test case\ninstance, and the logger you want to supervise.\n\nLike::\n\n class MyTestCase(unittest.TestCase):\n \"\"\"Example.\"\"\"\n\n def setUp(self):\n logassert.setup(self, 'mylogger')\n\nIn the example, ``mylogger`` is the name of the logging to supervise. If\ndifferent subsystems of your code log in other loggers, this tester\nwon't notice.\n\nThen, to use it, just call the ``assertLogged`` method and it's family,\npassing all the strings you want to find.\n\nExample::\n\n def test_blah(self):\n (...)\n self.assertLoggedDebug('secret', 'life', '42')\n\nThat line will check that \"secret\", \"life\" and \"42\" are all logged in the\nsame logging call, in DEBUG level.\n\nSo, if you logged this, the test will pass::\n\n logger.debug(\"The secret of life, the universe and everything is %d\", 42)\n\nNote that the message checked is the one with all parameters replaced.\n\nBut if you logged any of the following, the test will fail (the first because\nit misses one of the string, the second because it has the wrong log level)::\n\n logger.debug(\"The secret of life, the universe and everything is lost\")\n logger.info(\"The secret of life, the universe and everything is 42\")\n\n\nWhat can I test?\n----------------\n\nYou'll have at disposition several assertion methods:\n\n- self.assertLogged: will check that the strings were logged,\n no matter at which level\n\n- self.assertLoggedLEVEL (being LEVEL one of Error, Warning, Info, or\n Debug): will check that the strings were logged at that specific level.\n\n- self.assertNotLogged: will check that the strings were NOT logged,\n no matter at which level\n\n- self.assertNotLoggedLEVEL (being LEVEL one of Error, Warning, Info, or\n Debug): will check that the strings were NOT logged at that\n specific level.\n\n\nNice! But...\n------------\n\nIf you need help, or have any question, or found any issue, please open a\nticket `here `_.\n\nThanks in advance for your time.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/facundobatista/logassert", "keywords": null, "license": "LGPL-3", "maintainer": null, "maintainer_email": null, "name": "logassert", "package_url": "https://pypi.org/project/logassert/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/logassert/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/facundobatista/logassert" }, "release_url": "https://pypi.org/project/logassert/4/", "requires_dist": null, "requires_python": null, "summary": "Log Assertion.", "version": "4" }, "last_serial": 2319301, "releases": { "1": [ { "comment_text": "", "digests": { "md5": "7935b23a0f4a65ea9816fe1b4f7c2750", "sha256": "c8ee6a6acc80ffdf82a7101caec3658994dc331f5f9c0c1a2f47e52f921a8f9c" }, "downloads": -1, "filename": "logassert-1.tar.gz", "has_sig": false, "md5_digest": "7935b23a0f4a65ea9816fe1b4f7c2750", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5490, "upload_time": "2015-04-30T22:01:56", "url": "https://files.pythonhosted.org/packages/84/90/3930b4bb530b24b2834c7d5d08baa4529a17e7d5359aaddabbe8ec889986/logassert-1.tar.gz" } ], "2": [ { "comment_text": "", "digests": { "md5": "0dd6e6370f3455da5cee907a0c6dbfdd", "sha256": "a36d029ca69f905caeb00f2da56a4fd5d82b4a6c0d653e2dfa7674102218f232" }, "downloads": -1, "filename": "logassert-2.tar.gz", "has_sig": false, "md5_digest": "0dd6e6370f3455da5cee907a0c6dbfdd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5810, "upload_time": "2015-07-03T17:39:31", "url": "https://files.pythonhosted.org/packages/2e/90/741932ef3e42a7adf71748dee36b191b3ade3d154c41e66bca8393ea97c5/logassert-2.tar.gz" } ], "3": [ { "comment_text": "", "digests": { "md5": "472bd035cb41bc7e136f3eb0203941ff", "sha256": "25dbce5052db84f3fe3505d2d0ae73ee061d78103a3fd08a20c5ebb995e8194f" }, "downloads": -1, "filename": "logassert-3.tar.gz", "has_sig": false, "md5_digest": "472bd035cb41bc7e136f3eb0203941ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5841, "upload_time": "2016-09-01T18:39:06", "url": "https://files.pythonhosted.org/packages/a7/22/05c817fb21f071fe834268a61a238864c1b9a593016e3e37ccb240310e12/logassert-3.tar.gz" } ], "4": [ { "comment_text": "", "digests": { "md5": "5011c7750c3a14258f879e3196b916d9", "sha256": "90b289ed6869e873f8cf55aa92db66ba8627436ab7d8623b090762ed62a2af4b" }, "downloads": -1, "filename": "logassert-4.tar.gz", "has_sig": false, "md5_digest": "5011c7750c3a14258f879e3196b916d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5838, "upload_time": "2016-09-01T19:11:39", "url": "https://files.pythonhosted.org/packages/79/dd/608ac53773a9d82862b83689067c4aab41fc72b6b0008259eb75e0423536/logassert-4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5011c7750c3a14258f879e3196b916d9", "sha256": "90b289ed6869e873f8cf55aa92db66ba8627436ab7d8623b090762ed62a2af4b" }, "downloads": -1, "filename": "logassert-4.tar.gz", "has_sig": false, "md5_digest": "5011c7750c3a14258f879e3196b916d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5838, "upload_time": "2016-09-01T19:11:39", "url": "https://files.pythonhosted.org/packages/79/dd/608ac53773a9d82862b83689067c4aab41fc72b6b0008259eb75e0423536/logassert-4.tar.gz" } ] }