pytest-flexreport


Namepytest-flexreport JSON
Version 1.1.17 PyPI version JSON
download
home_pagehttps://github.com/txu2k8/pytest-flexreport
Summary
upload_time2023-02-05 14:23:43
maintainerflexreport
docs_urlNone
authorTXU
requires_python>=3.5
licenseMIT
keywords
VCS
bugtrack_url
requirements pytest Jinja2 pydantic
Travis-CI
coveralls test coverage No coveralls.
            # pytest-flexreport

### 1、介绍
pytest-flexreport是针对pytest的生成html报告的插件,自动收集用例执行的详细日志信息,以及相关错误和输出信息。使用起来非常简单,安装好pytest-testreport之后,运行用例时加上参数即可生成报告   

### 2、安装

pytest-testreport是基于python3.6开发的,安装前请确认你的python版本>3.6

安装命令

```pip install pytest-flexreport```

### 3、快速开始

###### 注意:如果安装了pytest-html这个插件,请先卸载,不然可能会有冲突

##### 使用案例:

- ###### 命令行执行: pytest 运行测试时加上参数--report 指定报告文件名

    ```shell
    # 指定报告文件名
    pytest --report=musen.html
    
    #其他配置参数
    --report=html报告文件路径
    --history_dir=history.json的目录路径,默认使用html文件同级目录
    --title=指定报告标题
    --tester=指定报告中的测试者
    --desc = 指定报告中的项目描述
    
    # 同时使用多个参数
    pytest --report=report.html --history_dir=./reports --title=测试报告 --tester=测试A --desc=项目描述
    ```
    
- ###### pytest.main执行

    ```shell
    import pytest
    
    pytest.main(['--report=musen.html',
                 '--history_dir=./reports',
                 '--title=测试报告标题',
                 '--tester=木森',
                 '--desc=报告描述信息'])
    ```
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/txu2k8/pytest-flexreport",
    "name": "pytest-flexreport",
    "maintainer": "flexreport",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "tao.xu2008@outlook.com",
    "keywords": "",
    "author": "TXU",
    "author_email": "tao.xu2008@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/c2/15/ccd860ae3ca4003ebfe4af23504e6a9b1e4fb4eeebfb85a7e8f06b79bc6d/pytest-flexreport-1.1.17.tar.gz",
    "platform": null,
    "description": "# pytest-flexreport\n\n### 1\u3001\u4ecb\u7ecd\npytest-flexreport\u662f\u9488\u5bf9pytest\u7684\u751f\u6210html\u62a5\u544a\u7684\u63d2\u4ef6\uff0c\u81ea\u52a8\u6536\u96c6\u7528\u4f8b\u6267\u884c\u7684\u8be6\u7ec6\u65e5\u5fd7\u4fe1\u606f\uff0c\u4ee5\u53ca\u76f8\u5173\u9519\u8bef\u548c\u8f93\u51fa\u4fe1\u606f\u3002\u4f7f\u7528\u8d77\u6765\u975e\u5e38\u7b80\u5355\uff0c\u5b89\u88c5\u597dpytest-testreport\u4e4b\u540e\uff0c\u8fd0\u884c\u7528\u4f8b\u65f6\u52a0\u4e0a\u53c2\u6570\u5373\u53ef\u751f\u6210\u62a5\u544a   \n\n### 2\u3001\u5b89\u88c5\n\npytest-testreport\u662f\u57fa\u4e8epython3.6\u5f00\u53d1\u7684\uff0c\u5b89\u88c5\u524d\u8bf7\u786e\u8ba4\u4f60\u7684python\u7248\u672c>3.6\n\n\u5b89\u88c5\u547d\u4ee4\n\n```pip install pytest-flexreport```\n\n### 3\u3001\u5feb\u901f\u5f00\u59cb\n\n###### \u6ce8\u610f\uff1a\u5982\u679c\u5b89\u88c5\u4e86pytest-html\u8fd9\u4e2a\u63d2\u4ef6\uff0c\u8bf7\u5148\u5378\u8f7d\uff0c\u4e0d\u7136\u53ef\u80fd\u4f1a\u6709\u51b2\u7a81\n\n##### \u4f7f\u7528\u6848\u4f8b\uff1a\n\n- ###### \u547d\u4ee4\u884c\u6267\u884c\uff1a pytest \u8fd0\u884c\u6d4b\u8bd5\u65f6\u52a0\u4e0a\u53c2\u6570--report \u6307\u5b9a\u62a5\u544a\u6587\u4ef6\u540d\n\n    ```shell\n    # \u6307\u5b9a\u62a5\u544a\u6587\u4ef6\u540d\n    pytest --report=musen.html\n    \n    #\u5176\u4ed6\u914d\u7f6e\u53c2\u6570\n    --report=html\u62a5\u544a\u6587\u4ef6\u8def\u5f84\n    --history_dir=history.json\u7684\u76ee\u5f55\u8def\u5f84\uff0c\u9ed8\u8ba4\u4f7f\u7528html\u6587\u4ef6\u540c\u7ea7\u76ee\u5f55\n    --title=\u6307\u5b9a\u62a5\u544a\u6807\u9898\n    --tester=\u6307\u5b9a\u62a5\u544a\u4e2d\u7684\u6d4b\u8bd5\u8005\n    --desc = \u6307\u5b9a\u62a5\u544a\u4e2d\u7684\u9879\u76ee\u63cf\u8ff0\n    \n    # \u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u53c2\u6570\n    pytest --report=report.html --history_dir=./reports --title=\u6d4b\u8bd5\u62a5\u544a --tester=\u6d4b\u8bd5A --desc=\u9879\u76ee\u63cf\u8ff0\n    ```\n    \n- ###### pytest.main\u6267\u884c\n\n    ```shell\n    import pytest\n    \n    pytest.main(['--report=musen.html',\n                 '--history_dir=./reports',\n                 '--title=\u6d4b\u8bd5\u62a5\u544a\u6807\u9898',\n                 '--tester=\u6728\u68ee',\n                 '--desc=\u62a5\u544a\u63cf\u8ff0\u4fe1\u606f'])\n    ```",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "1.1.17",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c215ccd860ae3ca4003ebfe4af23504e6a9b1e4fb4eeebfb85a7e8f06b79bc6d",
                "md5": "7e67b3f10e826da97756ba090707a09f",
                "sha256": "5d1388a53d6d3921128ce6b659d2b33b76a4d0d62ba917b825175f5866dfc50f"
            },
            "downloads": -1,
            "filename": "pytest-flexreport-1.1.17.tar.gz",
            "has_sig": false,
            "md5_digest": "7e67b3f10e826da97756ba090707a09f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 243839,
            "upload_time": "2023-02-05T14:23:43",
            "upload_time_iso_8601": "2023-02-05T14:23:43.791749Z",
            "url": "https://files.pythonhosted.org/packages/c2/15/ccd860ae3ca4003ebfe4af23504e6a9b1e4fb4eeebfb85a7e8f06b79bc6d/pytest-flexreport-1.1.17.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-05 14:23:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "txu2k8",
    "github_project": "pytest-flexreport",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "appveyor": true,
    "requirements": [
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "Jinja2",
            "specs": []
        },
        {
            "name": "pydantic",
            "specs": []
        }
    ],
    "tox": true,
    "lcname": "pytest-flexreport"
}
        
TXU
Elapsed time: 0.08188s