{ "info": { "author": "Meme Dough", "author_email": "memedough@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Testing" ], "description": "pytest-capturelog\n=================\n\npy.test plugin to capture log messages\n\nInstallation\n------------\n\nThe `pytest-capturelog`_ package may be installed with pip or easy_install::\n\n pip install pytest-capturelog\n easy_install pytest-capturelog\n\n.. _`pytest-capturelog`: http://pypi.python.org/pypi/pytest-capturelog/\n\nUsage\n-----\n\nIf the plugin is installed log messages are captured by default and for\neach failed test will be shown in the same manner as captured stdout and\nstderr.\n\nRunning without options::\n\n py.test test_capturelog.py\n\nShows failed tests like so::\n\n -------------------------- Captured log ---------------------------\n test_capturelog.py 26 INFO text going to logger\n ------------------------- Captured stdout -------------------------\n text going to stdout\n ------------------------- Captured stderr -------------------------\n text going to stderr\n ==================== 2 failed in 0.02 seconds =====================\n\nBy default each captured log message shows the module, line number,\nlog level and message. Showing the exact module and line number is\nuseful for testing and debugging. If desired the log format and date\nformat can be specified to anything that the logging module supports.\n\nRunning pytest specifying formatting options::\n\n py.test --log-format=\"%(asctime)s %(levelname)s %(message)s\" --log-date-format=\"%Y-%m-%d %H:%M:%S\" test_capturelog.py\n\nShows failed tests like so::\n\n -------------------------- Captured log ---------------------------\n 2010-04-10 14:48:44 INFO text going to logger\n ------------------------- Captured stdout -------------------------\n text going to stdout\n ------------------------- Captured stderr -------------------------\n text going to stderr\n ==================== 2 failed in 0.02 seconds =====================\n\nFurther it is possible to disable capturing of logs completely with::\n\n py.test --nocapturelog test_capturelog.py\n\nShows failed tests in the normal manner as no logs were captured::\n\n ------------------------- Captured stdout -------------------------\n text going to stdout\n ------------------------- Captured stderr -------------------------\n text going to stderr\n ==================== 2 failed in 0.02 seconds =====================\n\nInside tests it is possible to change the log level for the captured\nlog messages. This is supported by the ``caplog`` funcarg::\n\n def test_foo(caplog):\n caplog.setLevel(logging.INFO)\n pass\n\nBy default the level is set on the handler used to capture the log\nmessages, however as a convenience it is also possible to set the log\nlevel of any logger::\n\n def test_foo(caplog):\n caplog.setLevel(logging.CRITICAL, logger='root.baz')\n pass\n\nIt is also possible to use a context manager to temporarily change the\nlog level::\n\n def test_bar(caplog):\n with caplog.atLevel(logging.INFO):\n pass\n\nAgain, by default the level of the handler is affected but the level\nof any logger can be changed instead with::\n\n def test_bar(caplog):\n with caplog.atLevel(logging.CRITICAL, logger='root.baz'):\n pass\n\nLastly all the logs sent to the logger during the test run are made\navailable on the funcarg in the form of both the LogRecord instances\nand the final log text. This is useful for when you want to assert on\nthe contents of a message::\n\n def test_baz(caplog):\n func_under_test()\n for record in caplog.records():\n assert record.levelname != 'CRITICAL'\n assert 'wally' not in caplog.text()\n\nFor all the available attributes of the log records see the\n``logging.LogRecord`` class.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/memedough/pytest-capturelog/overview", "keywords": "py.test pytest", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "pytest-capturelog", "package_url": "https://pypi.org/project/pytest-capturelog/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pytest-capturelog/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/memedough/pytest-capturelog/overview" }, "release_url": "https://pypi.org/project/pytest-capturelog/0.7/", "requires_dist": null, "requires_python": null, "summary": "py.test plugin to capture log messages", "version": "0.7" }, "last_serial": 797814, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "024f2e62dd1689afca894d2b843b6d8c", "sha256": "f00bef77cd60288dd14ce85ac366e5c8012cbdb409a36cffaf6a0a260b90b2d3" }, "downloads": -1, "filename": "pytest-capturelog-0.1.tar.gz", "has_sig": false, "md5_digest": "024f2e62dd1689afca894d2b843b6d8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1748, "upload_time": "2010-03-14T10:13:00", "url": "https://files.pythonhosted.org/packages/e0/d6/dcd7f124bb228efa7d2187d22eb53a026c59d766fcce8f6c3928280ec455/pytest-capturelog-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "cb96db8a4b52fe20dcda28fc8821864e", "sha256": "bd050f2c9e8cf1c38e195e124e36ae7b262a7755db8a844ed253d82f0ef2c87e" }, "downloads": -1, "filename": "pytest-capturelog-0.2.tar.gz", "has_sig": false, "md5_digest": "cb96db8a4b52fe20dcda28fc8821864e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1906, "upload_time": "2010-03-15T14:07:59", "url": "https://files.pythonhosted.org/packages/81/42/3f39cf52a8e0d1df1076cd654eead585b1d360622ab0ef23140a81862b2d/pytest-capturelog-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "5a4386efd8883836e3c8aa1558440aaf", "sha256": "529a86adacccc49c6a677b03336d73fbbda34e64efe40c4936f942395599891d" }, "downloads": -1, "filename": "pytest-capturelog-0.3.tar.gz", "has_sig": false, "md5_digest": "5a4386efd8883836e3c8aa1558440aaf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2451, "upload_time": "2010-03-28T07:00:27", "url": "https://files.pythonhosted.org/packages/8e/08/2e956b9993df183a9ceafb5a31fd9343e0810dd1ef09490a45ad72fc3557/pytest-capturelog-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "a3cb61fcb135a258d5de59c9e59804dd", "sha256": "3c8ad2ab2b221c5754db645ddeee20703fc38072f52b2bb90c5ae612cb7bbafc" }, "downloads": -1, "filename": "pytest-capturelog-0.4.tar.gz", "has_sig": false, "md5_digest": "a3cb61fcb135a258d5de59c9e59804dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3012, "upload_time": "2010-04-10T07:10:07", "url": "https://files.pythonhosted.org/packages/aa/72/bd51d60d51d4ce63fe36a89f78fe41991e0ab456298d9ed6a99c647f8ffe/pytest-capturelog-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "bd471e64bb832209e21220ea8ee5e33a", "sha256": "b0dd80918e8cc21b643e32a023117890a7925fbfbb8fcbfa3eb8af1893d6f6d6" }, "downloads": -1, "filename": "pytest-capturelog-0.5.tar.gz", "has_sig": false, "md5_digest": "bd471e64bb832209e21220ea8ee5e33a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3123, "upload_time": "2010-04-13T14:33:08", "url": "https://files.pythonhosted.org/packages/00/9b/195c93bb8677a10b02de973c00fcff9ad740251be087b2c6167a658868d7/pytest-capturelog-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "f8c59f9739d3338d6dec0800810375c4", "sha256": "37f82896599f2f300e1f05d0fed85c5f7b1ade1840f472de180bbbd78de8eb9b" }, "downloads": -1, "filename": "pytest-capturelog-0.6.tar.gz", "has_sig": false, "md5_digest": "f8c59f9739d3338d6dec0800810375c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4280, "upload_time": "2010-12-05T09:43:02", "url": "https://files.pythonhosted.org/packages/00/78/b068fde32e362308c99f8a83fa36bf62ea4e0f70e7d6b65740af5b9d1bb1/pytest-capturelog-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "cfeac23d8ed254deaeb50a8c0aa141e9", "sha256": "b6e8d5189b39462109c2188e6b512d6cc7e66d62bb5be65389ed50e96d22000d" }, "downloads": -1, "filename": "pytest-capturelog-0.7.tar.gz", "has_sig": false, "md5_digest": "cfeac23d8ed254deaeb50a8c0aa141e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4293, "upload_time": "2010-12-07T13:46:01", "url": "https://files.pythonhosted.org/packages/35/e9/6051b5bb65ad5049d5eb60127d34c63ba724e17acf8b1f2f2e0755131b6c/pytest-capturelog-0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cfeac23d8ed254deaeb50a8c0aa141e9", "sha256": "b6e8d5189b39462109c2188e6b512d6cc7e66d62bb5be65389ed50e96d22000d" }, "downloads": -1, "filename": "pytest-capturelog-0.7.tar.gz", "has_sig": false, "md5_digest": "cfeac23d8ed254deaeb50a8c0aa141e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4293, "upload_time": "2010-12-07T13:46:01", "url": "https://files.pythonhosted.org/packages/35/e9/6051b5bb65ad5049d5eb60127d34c63ba724e17acf8b1f2f2e0755131b6c/pytest-capturelog-0.7.tar.gz" } ] }