{ "info": { "author": "Arthur Skowronek (Fork Author)", "author_email": "eisensheng@mailbox.org", "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", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing" ], "description": "pytest-catchlog\n===============\n\n.. image:: https://badges.gitter.im/Join%20Chat.svg\n :alt: Join the chat at https://gitter.im/eisensheng/pytest-catchlog\n :target: https://gitter.im/eisensheng/pytest-catchlog?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\n\npy.test plugin to catch log messages. This is a fork of `pytest-capturelog`_.\n\n.. _`pytest-capturelog`: https://pypi.python.org/pypi/pytest-capturelog/\n\n\nInstallation\n------------\n\nThe `pytest-catchlog`_ package may be installed with pip or easy_install::\n\n pip install pytest-catchlog\n easy_install pytest-catchlog\n\n.. _`pytest-catchlog`: http://pypi.python.org/pypi/pytest-catchlog/\n\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_pytest_catchlog.py\n\nShows failed tests like so::\n\n ----------------------- Captured stdlog call ----------------------\n test_pytest_catchlog.py 26 INFO text going to logger\n ----------------------- Captured stdout call ----------------------\n text going to stdout\n ----------------------- Captured stderr call ----------------------\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\" \\\n --log-date-format=\"%Y-%m-%d %H:%M:%S\" test_pytest_catchlog.py\n\nShows failed tests like so::\n\n ----------------------- Captured stdlog call ----------------------\n 2010-04-10 14:48:44 INFO text going to logger\n ----------------------- Captured stdout call ----------------------\n text going to stdout\n ----------------------- Captured stderr call ----------------------\n text going to stderr\n ==================== 2 failed in 0.02 seconds =====================\n\nThese options can also be customized through a configuration file::\n\n [pytest]\n log_format = %(asctime)s %(levelname)s %(message)s\n log_date_format = %Y-%m-%d %H:%M:%S\n\nAlthough the same effect could be achieved through the ``addopts`` setting,\nusing dedicated options should be preferred since the latter doesn't\nforce other developers to have ``pytest-catchlog`` installed (while at\nthe same time, ``addopts`` approach would fail with 'unrecognized arguments'\nerror). Command line arguments take precedence.\n\nFurther it is possible to disable reporting logs on failed tests\ncompletely with::\n\n py.test --no-print-logs test_pytest_catchlog.py\n\nShows failed tests in the normal manner as no logs were captured::\n\n ----------------------- Captured stdout call ----------------------\n text going to stdout\n ----------------------- Captured stderr call ----------------------\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.set_level(logging.INFO)\n pass\n\nBy default the level is set on the handler used to catch 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.set_level(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.at_level(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.at_level(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.\n\nYou can also resort to ``record_tuples`` if all you want to do is to ensure,\nthat certain messages have been logged under a given logger name with a\ngiven severity and message::\n\n def test_foo(caplog):\n logging.getLogger().info('boo %s', 'arg')\n\n assert caplog.record_tuples == [\n ('root', logging.INFO, 'boo arg'),\n ]\n\n\nChangelog\n=========\n\nList of notable changes between pytest-catchlog releases.\n\n.. %UNRELEASED_SECTION%\n\n`1.2.2`_\n-------------\n\nReleased on 2016-01-24 UTC.\n\n- [Bugfix] `#30`_ `#31`_ - Fix ``unicode`` vs ``str`` compatibility issues between Python2 and Python3.\n (Thanks goes to `@sirex`_ for reporting the issue and providing a fix!)\n\n.. _#30: https://github.com/eisensheng/pytest-catchlog/issues/30\n.. _#31: https://github.com/eisensheng/pytest-catchlog/issues/31\n.. _@sirex: https://github.com/sirex\n\n\n`1.2.1`_\n-------------\n\nReleased on 2015-12-07.\n\n- [Bugfix] #18 - Allow ``caplog.records()`` to be modified. Thanks to Eldar Abusalimov for the PR and Marco Nenciarini for reporting the issue.\n- [Bugfix] #15 #17 - Restore Python 2.6 compatibility. (Thanks to Marco Nenciarini!)\n\n.. attention::\n Deprecation warning: the following objects (i.e. functions, properties)\n are slated for removal in the next major release.\n\n - ``caplog.at_level`` and ``caplog.set_level`` should be used instead of\n ``caplog.atLevel`` and ``caplog.setLevel``.\n\n The methods ``caplog.atLevel`` and ``caplog.setLevel`` are still\n available but deprecated and not supported since they don't follow\n the PEP8 convention for method names.\n\n - ``caplog.text``, ``caplog.records`` and\n ``caplog.record_tuples`` were turned into properties.\n They still can be used as regular methods for backward compatibility,\n but that syntax is considered deprecated and scheduled for removal in\n the next major release.\n\n\nVersion 1.2\n-----------\n\nReleased on 2015-11-08.\n\n- [Feature] #6 - Configure logging message and date format through ini file.\n- [Feature] #7 - Also catch logs from setup and teardown stages.\n- [Feature] #7 - Replace deprecated ``__multicall__`` use to support future Py.test releases.\n- [Feature] #11 - reintroduce ``setLevel`` and ``atLevel`` to retain backward compatibility with pytest-capturelog. Also the members ``text``, ``records`` and ``record_tuples`` of the ``caplog`` fixture can be used as properties now.\n\nSpecial thanks for this release goes to Eldar Abusalimov. He provided all of the changed features.\n\n\nVersion 1.1\n-----------\n\nReleased on 2015-06-07.\n\n- #2 - Explicitly state Python3 support and add configuration for running\n tests with tox on multiple Python versions. (Thanks to Jeremy Bowman!)\n- Add an option to silence logs completely on the terminal.\n\n\nVersion 1.0\n-----------\n\nReleased on 2014-12-08.\n\n- Add ``record_tuples`` for comparing recorded log entries against expected\n log entries with their logger name, severity and formatted message.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/eisensheng/pytest-catchlog", "keywords": "py.test pytest logging", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "pytest-catchlog", "package_url": "https://pypi.org/project/pytest-catchlog/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pytest-catchlog/", "project_urls": { "Homepage": "https://github.com/eisensheng/pytest-catchlog" }, "release_url": "https://pypi.org/project/pytest-catchlog/1.2.2/", "requires_dist": [ "py (>=1.1.1)", "pytest (>=2.6)" ], "requires_python": "", "summary": "py.test plugin to catch log messages. This is a fork of pytest-capturelog.", "version": "1.2.2" }, "last_serial": 1920240, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "3af2e8fb2731909036175fa47df8af21", "sha256": "4b3b9d1819cc00b836b26caf559eaf49de6ec0325ba7c84745d96924f09c3a28" }, "downloads": -1, "filename": "pytest_catchlog-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "3af2e8fb2731909036175fa47df8af21", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 6776, "upload_time": "2014-12-08T18:33:48", "url": "https://files.pythonhosted.org/packages/8d/b8/8499bfa70e18b2f770a3050eda55d362887da5734b77fc3ca8fd78615e2a/pytest_catchlog-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a1f16aac5420c5e6724371d1aa211dec", "sha256": "215c8f3a247196bd6fcf59f95f978c3b7deef28fbcdb4014d254bc81e8398483" }, "downloads": -1, "filename": "pytest-catchlog-1.0.zip", "has_sig": false, "md5_digest": "a1f16aac5420c5e6724371d1aa211dec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10508, "upload_time": "2014-12-08T18:33:32", "url": "https://files.pythonhosted.org/packages/09/02/490f51b6fe18ccd23e105f8fbfea2df330e6442e1184a6796759d87504e9/pytest-catchlog-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "783a7d2721741785a3d9848efe407061", "sha256": "b10563e0aa53ad62c44dce5742a0d15f79b54dc211f37599c16b63ed879e849a" }, "downloads": -1, "filename": "pytest_catchlog-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "783a7d2721741785a3d9848efe407061", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 7334, "upload_time": "2015-06-07T12:00:55", "url": "https://files.pythonhosted.org/packages/8e/87/5ca52020caef2ab46cec1adb1166fc9466e3a0c08c28a1386abc057c096d/pytest_catchlog-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "58d7dc513fd2b5d55f5c2c3e08013be8", "sha256": "3b368343e9b61741f6d92bcf6c10fee340a09bca87d29218062710eda3020979" }, "downloads": -1, "filename": "pytest-catchlog-1.1.zip", "has_sig": false, "md5_digest": "58d7dc513fd2b5d55f5c2c3e08013be8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11789, "upload_time": "2015-10-03T13:47:42", "url": "https://files.pythonhosted.org/packages/e5/7b/58e6213fb03ec00c73bd8b275c0ff943015b79d67ba31f4f6ee692f7167f/pytest-catchlog-1.1.zip" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "87297fa1eb85266a46a9be4d6e63c477", "sha256": "12ba423bb4c058cad576245be139a5b3fe749c26e75a78d075a5c4711077ea31" }, "downloads": -1, "filename": "pytest_catchlog-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "87297fa1eb85266a46a9be4d6e63c477", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8553, "upload_time": "2015-11-08T22:15:01", "url": "https://files.pythonhosted.org/packages/81/46/85ba1ad0c7ca1b5799e43c72303384406445b1ec0274d50ccc8be22fb8fb/pytest_catchlog-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c1f4d6425370b9c172a57c3f09f8297d", "sha256": "e419a4efc706c948fbac2c5e8a35bb6f16edb3bb0643b86ba28b6bc69e792d32" }, "downloads": -1, "filename": "pytest-catchlog-1.2.0.zip", "has_sig": false, "md5_digest": "c1f4d6425370b9c172a57c3f09f8297d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13620, "upload_time": "2015-11-08T22:15:13", "url": "https://files.pythonhosted.org/packages/e5/13/8cf42c940d78d2a7716a7bf1c3c5858ac091552d6f950d407dcdb214b601/pytest-catchlog-1.2.0.zip" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "5a9ec4fd8f3711b1bafc2b6c62b1edc9", "sha256": "f7835e01ad773030de32fda5f76a8a11a46771ea885de01878a3e72510eb7b28" }, "downloads": -1, "filename": "pytest_catchlog-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5a9ec4fd8f3711b1bafc2b6c62b1edc9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10362, "upload_time": "2015-12-07T22:02:07", "url": "https://files.pythonhosted.org/packages/8d/4c/0f388264fe12b4b86fb3e7c275ac10dadfe697f7c4274c69ce819e0f806f/pytest_catchlog-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74603999f2132a6afc4147a324ac93dc", "sha256": "9e9ecdeff56666f8a2fd1bee2f6ca3b1be30f1fcfb17fdf9bbd0e95d53feec83" }, "downloads": -1, "filename": "pytest-catchlog-1.2.1.zip", "has_sig": false, "md5_digest": "74603999f2132a6afc4147a324ac93dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17263, "upload_time": "2015-12-07T22:03:15", "url": "https://files.pythonhosted.org/packages/0c/06/dfc4deb6657c92199c4c171f6aca05be4b939a17759e6634437da257a596/pytest-catchlog-1.2.1.zip" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "1196a204f380970bb945f80ba0468201", "sha256": "a692966da726b918197cabd20dc0ad4da5503fbdc99baaa192e62579c8a45773" }, "downloads": -1, "filename": "pytest_catchlog-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1196a204f380970bb945f80ba0468201", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10780, "upload_time": "2016-01-24T15:24:22", "url": "https://files.pythonhosted.org/packages/86/84/6bd1384196a6871a9108157ec934a1e1ee0078582cd208b43352566a86dc/pytest_catchlog-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09d890c54c7456c818102b7ff8c182c8", "sha256": "4be15dc5ac1750f83960897f591453040dff044b5966fe24a91c2f7d04ecfcf0" }, "downloads": -1, "filename": "pytest-catchlog-1.2.2.zip", "has_sig": false, "md5_digest": "09d890c54c7456c818102b7ff8c182c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18028, "upload_time": "2016-01-24T15:24:27", "url": "https://files.pythonhosted.org/packages/f2/2b/2faccdb1a978fab9dd0bf31cca9f6847fbe9184a0bdcc3011ac41dd44191/pytest-catchlog-1.2.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1196a204f380970bb945f80ba0468201", "sha256": "a692966da726b918197cabd20dc0ad4da5503fbdc99baaa192e62579c8a45773" }, "downloads": -1, "filename": "pytest_catchlog-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1196a204f380970bb945f80ba0468201", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10780, "upload_time": "2016-01-24T15:24:22", "url": "https://files.pythonhosted.org/packages/86/84/6bd1384196a6871a9108157ec934a1e1ee0078582cd208b43352566a86dc/pytest_catchlog-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "09d890c54c7456c818102b7ff8c182c8", "sha256": "4be15dc5ac1750f83960897f591453040dff044b5966fe24a91c2f7d04ecfcf0" }, "downloads": -1, "filename": "pytest-catchlog-1.2.2.zip", "has_sig": false, "md5_digest": "09d890c54c7456c818102b7ff8c182c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18028, "upload_time": "2016-01-24T15:24:27", "url": "https://files.pythonhosted.org/packages/f2/2b/2faccdb1a978fab9dd0bf31cca9f6847fbe9184a0bdcc3011ac41dd44191/pytest-catchlog-1.2.2.zip" } ] }