=====================
pytest-reporter-html1
=====================
.. image:: https://img.shields.io/pypi/v/pytest-reporter-html1.svg
:target: https://pypi.org/project/pytest-reporter-html1
:alt: PyPI version
A basic HTML report for `pytest`_ using `Jinja2`_ template engine.
Based on `pytest-reporter`_ which provides the data to the template.
Features
--------
* Overview of files, tests, and phases with expandable sections
* Includes information about tests such as documentation, markers, and fixtures
* Fairly mobile friendly
* Complies with Jenkins default CSP policy (with ``--split-report``)
* Support for `pytest-metadata`_ and `pytest-rerunfailures`_
* May be used as a base template for customization
.. image:: https://raw.githubusercontent.com/christiansandberg/pytest-reporter-html1/master/screenshot.png
:alt: Screenshot
Installation
------------
You can install "pytest-reporter-html1" via `pip`_ from `PyPI`_::
$ pip install pytest-reporter-html1
Usage
-----
Specify the html1 template and the output path of the report::
$ pytest --template=html1/index.html --report=report.html
By default the report is self-contained, but you can separate CSS, images,
and JavaScript by specifying the ``--split-report`` option.
Customization
-------------
You can inherit this template in your own to tailor parts of it to your own needs.
It defines various blocks which you can override using `template inheritance`_.
.. code:: html
{% extends "html1/index.html" %}
{% block style %}
{{ super() }}
header {
background-color: black;
}
{% endblock %}
Some additional filters are available for templates to use:
``asset(path_or_content, extension)``
Takes a path to a local file or a raw bytes object and either returns a
base64 encoded URL or a new relative URL to a copy depending on if the
report is self-contained or not.
.. code:: html
<img src="{{ 'path/to/image.png'|asset }}">
<img src="{{ raw_byte_data|asset('png') }}">
``ansi(s)``
Convert ANSI color codes to HTML.
``strftime(value, format)``
Format a Unix timestamp using `datetime.strftime`_.
.. code:: html
Started: {{ started|strftime('%Y-%m-%d %H:%M:%S') }}
``timedelta(value)``
Convert a time in seconds to a `timedelta`_ object.
``rst(s)``
Convert reStructuredText to HTML.
Issues
------
If you encounter any problems, please `file an issue`_ along with a detailed description.
.. _`Jinja2`: https://jinja.palletsprojects.com/
.. _`template inheritance`: https://jinja.palletsprojects.com/en/master/templates/#template-inheritance
.. _`file an issue`: https://github.com/christiansandberg/pytest-reporter-html1/issues
.. _`pytest`: https://github.com/pytest-dev/pytest
.. _`pytest-reporter`: https://github.com/christiansandberg/pytest-reporter
.. _`pytest-metadata`: https://github.com/pytest-dev/pytest-metadata
.. _`pytest-rerunfailures`: https://github.com/pytest-dev/pytest-rerunfailures
.. _`pip`: https://pypi.org/project/pip/
.. _`PyPI`: https://pypi.org/project
.. _`datetime.strftime`: https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime
.. _`timedelta`: https://docs.python.org/3/library/datetime.html#timedelta-objects
Raw data
{
"_id": null,
"home_page": "https://github.com/christiansandberg/pytest-reporter-html1",
"name": "pytest-reporter-html1",
"maintainer": "Christian Sandberg",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "christiansandberg@me.com",
"keywords": "",
"author": "Christian Sandberg",
"author_email": "christiansandberg@me.com",
"download_url": "https://files.pythonhosted.org/packages/5c/37/32f1316a2d8c62fc3bb8a8f04a776d2ae44178566226e6f6481449a230bf/pytest-reporter-html1-0.8.4.tar.gz",
"platform": null,
"description": "=====================\r\npytest-reporter-html1\r\n=====================\r\n\r\n.. image:: https://img.shields.io/pypi/v/pytest-reporter-html1.svg\r\n :target: https://pypi.org/project/pytest-reporter-html1\r\n :alt: PyPI version\r\n\r\nA basic HTML report for `pytest`_ using `Jinja2`_ template engine.\r\nBased on `pytest-reporter`_ which provides the data to the template.\r\n\r\n\r\nFeatures\r\n--------\r\n\r\n* Overview of files, tests, and phases with expandable sections\r\n* Includes information about tests such as documentation, markers, and fixtures\r\n* Fairly mobile friendly\r\n* Complies with Jenkins default CSP policy (with ``--split-report``)\r\n* Support for `pytest-metadata`_ and `pytest-rerunfailures`_\r\n* May be used as a base template for customization\r\n\r\n.. image:: https://raw.githubusercontent.com/christiansandberg/pytest-reporter-html1/master/screenshot.png\r\n :alt: Screenshot\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nYou can install \"pytest-reporter-html1\" via `pip`_ from `PyPI`_::\r\n\r\n $ pip install pytest-reporter-html1\r\n\r\n\r\nUsage\r\n-----\r\n\r\nSpecify the html1 template and the output path of the report::\r\n\r\n $ pytest --template=html1/index.html --report=report.html\r\n\r\nBy default the report is self-contained, but you can separate CSS, images,\r\nand JavaScript by specifying the ``--split-report`` option.\r\n\r\n\r\nCustomization\r\n-------------\r\n\r\nYou can inherit this template in your own to tailor parts of it to your own needs.\r\nIt defines various blocks which you can override using `template inheritance`_.\r\n\r\n.. code:: html\r\n\r\n {% extends \"html1/index.html\" %}\r\n {% block style %}\r\n {{ super() }}\r\n header {\r\n background-color: black;\r\n }\r\n {% endblock %}\r\n\r\nSome additional filters are available for templates to use:\r\n\r\n``asset(path_or_content, extension)``\r\n Takes a path to a local file or a raw bytes object and either returns a\r\n base64 encoded URL or a new relative URL to a copy depending on if the\r\n report is self-contained or not.\r\n\r\n .. code:: html\r\n\r\n <img src=\"{{ 'path/to/image.png'|asset }}\">\r\n <img src=\"{{ raw_byte_data|asset('png') }}\">\r\n\r\n``ansi(s)``\r\n Convert ANSI color codes to HTML.\r\n\r\n``strftime(value, format)``\r\n Format a Unix timestamp using `datetime.strftime`_.\r\n\r\n .. code:: html\r\n\r\n Started: {{ started|strftime('%Y-%m-%d %H:%M:%S') }}\r\n\r\n``timedelta(value)``\r\n Convert a time in seconds to a `timedelta`_ object.\r\n\r\n``rst(s)``\r\n Convert reStructuredText to HTML.\r\n\r\n\r\nIssues\r\n------\r\n\r\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\r\n\r\n.. _`Jinja2`: https://jinja.palletsprojects.com/\r\n.. _`template inheritance`: https://jinja.palletsprojects.com/en/master/templates/#template-inheritance\r\n.. _`file an issue`: https://github.com/christiansandberg/pytest-reporter-html1/issues\r\n.. _`pytest`: https://github.com/pytest-dev/pytest\r\n.. _`pytest-reporter`: https://github.com/christiansandberg/pytest-reporter\r\n.. _`pytest-metadata`: https://github.com/pytest-dev/pytest-metadata\r\n.. _`pytest-rerunfailures`: https://github.com/pytest-dev/pytest-rerunfailures\r\n.. _`pip`: https://pypi.org/project/pip/\r\n.. _`PyPI`: https://pypi.org/project\r\n.. _`datetime.strftime`: https://docs.python.org/3/library/datetime.html#datetime.datetime.strftime\r\n.. _`timedelta`: https://docs.python.org/3/library/datetime.html#timedelta-objects\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A basic HTML report template for Pytest",
"version": "0.8.4",
"project_urls": {
"Homepage": "https://github.com/christiansandberg/pytest-reporter-html1"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e9eb15d5944749b04500b60fa11cbe5bf849e4da42298500fc399eefa784dcfa",
"md5": "bb6d8613c6f6ca0d1c1d23734b539194",
"sha256": "2ff9acb07e11ec8bc245b723fc84c2ac3f4ffba8d6c6f690f3fd917258e0cd4f"
},
"downloads": -1,
"filename": "pytest_reporter_html1-0.8.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bb6d8613c6f6ca0d1c1d23734b539194",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 16426,
"upload_time": "2024-02-28T19:36:48",
"upload_time_iso_8601": "2024-02-28T19:36:48.918113Z",
"url": "https://files.pythonhosted.org/packages/e9/eb/15d5944749b04500b60fa11cbe5bf849e4da42298500fc399eefa784dcfa/pytest_reporter_html1-0.8.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5c3732f1316a2d8c62fc3bb8a8f04a776d2ae44178566226e6f6481449a230bf",
"md5": "66a4309e9d3ae3589f3d137e61fffb08",
"sha256": "30c609a29de691e59c61bc7c9dbf8e905e69c7e467b52ca9b7a1a4b316cd989d"
},
"downloads": -1,
"filename": "pytest-reporter-html1-0.8.4.tar.gz",
"has_sig": false,
"md5_digest": "66a4309e9d3ae3589f3d137e61fffb08",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 99799,
"upload_time": "2024-02-28T19:36:51",
"upload_time_iso_8601": "2024-02-28T19:36:51.004995Z",
"url": "https://files.pythonhosted.org/packages/5c/37/32f1316a2d8c62fc3bb8a8f04a776d2ae44178566226e6f6481449a230bf/pytest-reporter-html1-0.8.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-28 19:36:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "christiansandberg",
"github_project": "pytest-reporter-html1",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "pytest-reporter-html1"
}