{ "info": { "author": "Matt Chun-Lum", "author_email": "mchunlum@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", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "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-json\n===================================\n\n.. image:: https://travis-ci.org/mattcl/pytest-json.svg?branch=master\n :target: https://travis-ci.org/mattcl/pytest-json\n :alt: See Build Status on Travis CI\n\npytest-json is a plugin for `py.test `_ that generates JSON\nreports for test results\n\n----\n\nThis `Pytest`_ plugin was generated with `Cookiecutter`_ along with\n`@hackebrot`_'s `Cookiecutter-pytest-plugin`_ template.\n\n\nRequirements\n------------\n\n- Python 2.7, 3.3, 3.4, 3.5\n- py.test 2.7 or newer\n\n\nInstallation\n------------\n\nYou can install \"pytest-json\" via `pip`_ from `PyPI`_::\n\n $ pip install pytest-json\n\n\nUsage\n-----\n\n.. code-block::\n\n $ py.test --json=report.json\n\nor you can set the report path in an ini file::\n\n [pytest]\n json_report = report.json\n\nThe command-line option will override the ini file\n\nThere is an optional flag to normalize the generated report to\n`jsonapi `_. This is intended for (easier) consumption by\nember-data and others::\n\n $ py.test --json=report.json --jsonapi\n\nor you can set the jsonapi flag in an ini file::\n\n [pytest]\n jsonapi = anything\n\nNote that the value of the ini var can be anything. Presence alone will cause\nit to be true.\n\nAdding to environment\n---------------------\n\nYou can modify ``request.config._json_environment`` in a fixture\n\n.. code-block:: python\n\n @pytest.fixture(scope='session', autouse=True):\n def extra_json_environment(request):\n request.config._json_environment.append(('herp', 'derp'))\n\n\nAdding metadata per test stage\n------------------------------\n\nMetadata added via ``stage_metadata`` shows up in ``metadata`` field of the\nstage in the resulting JSON object\n\n.. code-block:: python\n\n # conftest.py\n @pytest.hookimpl(tryfirst=True, hookwrapper=True)\n def pytest_runtest_makereport(item, call):\n outcome = yield\n report = outcome.get_result()\n if report.when == 'call':\n report.stage_metadata = {\n 'foo': 'bar'\n }\n elif report.when == 'setup':\n report.stage_metadata = {\n 'hoof': 'doof'\n }\n elif report.when == 'teardown':\n report.stage_metadata = {\n 'herp': 'derp'\n }\n\n\nAddint metadata per test\n------------------------\n\nMetadata added on the tests themselves are represented by an array. To avoid\ncollisions, etc. Any stage (setup, teardown, call) that sets ``test_metadata``\non a report will have its metadata appended to the array. Metadata added via\n``test_metadata`` ends up in the ``metadata`` field of the test in the\nresulting JSON object\n\n.. code-block:: python\n\n # conftest.py\n @pytest.hookimpl(tryfirst=True, hookwrapper=True)\n def pytest_runtest_makereport(item, call):\n outcome = yield\n report = outcome.get_result()\n # only add this during call instead of during any stage\n if report.when == 'call':\n report.test_metadata = 'whatever'\n\n\nCompatibility with pytest-html\n------------------------------\n\nTo avoid issues with pytest-html, pytest-json uses\n``request.config._json_environment`` instead of ``request.config._environment``\n\nAdditionally, pytest-json ignores the ``extra`` field on reports.\n\n\nExample json\n------------\n\nA formatted example of the output can be found in example.json\n\nThe actual output is not formatted, but this was passed through jq for\nreadability.\n\nA formatted example of the jsonapi output can be found in example_jsonapi.json\n\nContributing\n------------\nContributions are very welcome. Tests can be run with `tox`_, please ensure\nthe coverage at least stays the same before you submit a pull request.\n\nLicense\n-------\n\nDistributed under the terms of the `MIT`_ license, \"pytest-json\" is free and open source software\n\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause\n.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`file an issue`: https://github.com/mattcl/pytest-json/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.org/en/latest/\n.. _`pip`: https://pypi.python.org/pypi/pip/\n.. _`PyPI`: https://pypi.python.org/pypi", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mattcl/pytest-json", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-json", "package_url": "https://pypi.org/project/pytest-json/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pytest-json/", "project_urls": { "Homepage": "https://github.com/mattcl/pytest-json" }, "release_url": "https://pypi.org/project/pytest-json/0.4.0/", "requires_dist": null, "requires_python": "", "summary": "Generate JSON test reports", "version": "0.4.0" }, "last_serial": 1909381, "releases": { "0.1.0": [], "0.1.3": [ { "comment_text": "", "digests": { "md5": "4998837b4d543394107a542ba2d6584e", "sha256": "9115c0a1e508359a3095de093f7691134d556e8237b3223e00f72e0bbba707a9" }, "downloads": -1, "filename": "pytest-json-0.1.3.tar.gz", "has_sig": false, "md5_digest": "4998837b4d543394107a542ba2d6584e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4471, "upload_time": "2015-12-27T09:09:24", "url": "https://files.pythonhosted.org/packages/23/0d/cc15cbd3c18a705ce71ece4acd2479aa72def4c7786e0f5b9739c2bc2de1/pytest-json-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "4b132603c5fc81142ac3a1eb951fc1b5", "sha256": "694accf7a237e121cfa607a6f706a7bb0158cb8db17177eec8173f21a4624dae" }, "downloads": -1, "filename": "pytest-json-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4b132603c5fc81142ac3a1eb951fc1b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4674, "upload_time": "2015-12-28T01:28:10", "url": "https://files.pythonhosted.org/packages/17/76/9fa9e179e53cacc58b223edc285c7d246d91c6bcd20da6b096667dc44467/pytest-json-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "eb6f713e99c395cdf3abb7aa9004c26c", "sha256": "dc3c17f20d203f569ae38ad76760ab86f1f53b77b56b0cb8d592a6867e8497dc" }, "downloads": -1, "filename": "pytest-json-0.2.1.tar.gz", "has_sig": false, "md5_digest": "eb6f713e99c395cdf3abb7aa9004c26c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4665, "upload_time": "2015-12-28T02:27:17", "url": "https://files.pythonhosted.org/packages/35/1a/679772ddfe1095edae98d649856420347808fa0271323f9ebb458c98901b/pytest-json-0.2.1.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "0b6a0a3cbecae12f8792fe0c916d5e12", "sha256": "0db2066bf70433ecce7de4c19c27aa290d7bc8856d6672a579d3924d9f882e17" }, "downloads": -1, "filename": "pytest-json-0.2.3.tar.gz", "has_sig": false, "md5_digest": "0b6a0a3cbecae12f8792fe0c916d5e12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4937, "upload_time": "2015-12-28T19:31:32", "url": "https://files.pythonhosted.org/packages/3b/ec/465ac202f8751f9b0009b48fd7524b31b3df8a921be6c1cb2524ede95249/pytest-json-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "5dd5a1395434e141f5e27796e90a1e22", "sha256": "be84d5b2b1b29a684466e1be924e69e683d563f27e991dda1c55fc29d8c174bc" }, "downloads": -1, "filename": "pytest-json-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5dd5a1395434e141f5e27796e90a1e22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5062, "upload_time": "2016-01-01T00:35:47", "url": "https://files.pythonhosted.org/packages/1e/8c/c765c578a7619b7e67b4db634c0a89a8fb4ab38b3753b8fc13874edccd67/pytest-json-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "c34f835e0dd31fbd79ee296aa43001f4", "sha256": "a68a7cb3787b75638cf196000161ae5259b216caeff28aa24d630c900a5bf560" }, "downloads": -1, "filename": "pytest-json-0.3.1.tar.gz", "has_sig": false, "md5_digest": "c34f835e0dd31fbd79ee296aa43001f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5064, "upload_time": "2016-01-05T10:53:20", "url": "https://files.pythonhosted.org/packages/6d/ae/f993ec4f0c3082fd42cc06fa625ce2f90e9fdc62bc0d587a1efb4cac4d75/pytest-json-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "0c9cd56e7f43199983c7e351ce7a631e", "sha256": "668c0b551f8b6fa0ecc5b02ab4e7ee835effa8993877f6d3408826f6895ef4df" }, "downloads": -1, "filename": "pytest-json-0.3.2.tar.gz", "has_sig": false, "md5_digest": "0c9cd56e7f43199983c7e351ce7a631e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5199, "upload_time": "2016-01-14T03:35:48", "url": "https://files.pythonhosted.org/packages/53/5e/eeaaefe337b94c4d64620ea91d3088c38207dff407a9549dacfeddaa09fa/pytest-json-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "df2dacb8ed2058fe6b32b577f2a27fad", "sha256": "e37cb4b05ac03f83a1745e2b87fefaf2556b4d6b476d41c599daa0bc7b13811f" }, "downloads": -1, "filename": "pytest-json-0.3.3.tar.gz", "has_sig": false, "md5_digest": "df2dacb8ed2058fe6b32b577f2a27fad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5222, "upload_time": "2016-01-15T21:38:01", "url": "https://files.pythonhosted.org/packages/f2/e7/0f2bbffd695251eca9f00c3a5b5851859d8865428ced2bcd2e5cff8a9f81/pytest-json-0.3.3.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "d5c8af61755626e04b526cf13cd1bb07", "sha256": "8bf4e1be1691f4416bc12b14785b5ad9e842887b0b2b2d61b37dcb555b208630" }, "downloads": -1, "filename": "pytest-json-0.4.0.tar.gz", "has_sig": false, "md5_digest": "d5c8af61755626e04b526cf13cd1bb07", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5669, "upload_time": "2016-01-18T06:33:27", "url": "https://files.pythonhosted.org/packages/f4/e2/b7a614e08a430e710b1424addbe1aa43af3108565d3abf71ac3046151fb3/pytest-json-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d5c8af61755626e04b526cf13cd1bb07", "sha256": "8bf4e1be1691f4416bc12b14785b5ad9e842887b0b2b2d61b37dcb555b208630" }, "downloads": -1, "filename": "pytest-json-0.4.0.tar.gz", "has_sig": false, "md5_digest": "d5c8af61755626e04b526cf13cd1bb07", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5669, "upload_time": "2016-01-18T06:33:27", "url": "https://files.pythonhosted.org/packages/f4/e2/b7a614e08a430e710b1424addbe1aa43af3108565d3abf71ac3046151fb3/pytest-json-0.4.0.tar.gz" } ] }