pytest-flexreport


Namepytest-flexreport JSON
Version 1.2.6 PyPI version JSON
download
home_pagehttps://github.com/txu2k8/pytest-flexreport
Summary
upload_time2023-04-15 05:45:55
maintainerflexreport
docs_urlNone
authorTXU
requires_python>=3.5
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # pytest-flexreport

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

### 2、安装

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

安装命令

```pip install pytest-flexreport```

### 3、快速开始

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

##### 3.1 template介绍
- --template=1:白底报告,以用例为维度,含详情
- --template=2:蓝底报告,以用例为维度,含详情
- --template=3:蓝底报告,结果概述,统计模块通过率(使用场景:邮件发送summary)

##### 3.2 使用案例

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

    ```shell
    # 指定报告文件名
    pytest --report=demo-report.html
    
    #其他配置参数
    --template=3, 测试报告模板选择(1,2,3)
    --report=/*/*.html, 报告生成绝对路径
    --history_dir=history.json的目录路径,默认使用html文件同级目录
    --title=测试报告标题, 回填到报告
    --tester=测试人员,回填到报告
    --desc=测试构建描述,回填到报告
    --log_path=测试日志路径, 回填到报告(template=3)
    --report_path=测试报告详情路径, 回填到报告(template=3)
    --testcase_basename=测试用例root-dir basename, 供遍历__init__.py查找模块名(template=3)
    
    # 同时使用多个参数
    pytest --report=report.html --history_dir=./reports --title=测试报告 --tester=txu --desc=项目描述
    ```
    
- ###### pytest.main执行

    ```shell
    import pytest
    
    pytest.main(['--report=demo-report.html',
                 '--history_dir=./reports',
                 '--title=测试报告标题',
                 '--tester=txu',
                 '--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/2f/77/2fae779525450b082b9b4b99b2cca6a396883308859f1e56c881850c8d00/pytest-flexreport-1.2.6.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\n\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.7+\u5f00\u53d1\u7684\uff0c\u5b89\u88c5\u524d\u8bf7\u786e\u8ba4\u4f60\u7684python\u7248\u672c>3.7\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\u53ef\u80fd\u4f1a\u6709\u51b2\u7a81\uff0c\u5982\u679c\u51b2\u7a81\u5219\u5148\u5378\u8f7dpytest-html\n\n##### 3.1 template\u4ecb\u7ecd\n- --template=1\uff1a\u767d\u5e95\u62a5\u544a\uff0c\u4ee5\u7528\u4f8b\u4e3a\u7ef4\u5ea6\uff0c\u542b\u8be6\u60c5\n- --template=2\uff1a\u84dd\u5e95\u62a5\u544a\uff0c\u4ee5\u7528\u4f8b\u4e3a\u7ef4\u5ea6\uff0c\u542b\u8be6\u60c5\n- --template=3\uff1a\u84dd\u5e95\u62a5\u544a\uff0c\u7ed3\u679c\u6982\u8ff0\uff0c\u7edf\u8ba1\u6a21\u5757\u901a\u8fc7\u7387\uff08\u4f7f\u7528\u573a\u666f\uff1a\u90ae\u4ef6\u53d1\u9001summary\uff09\n\n##### 3.2 \u4f7f\u7528\u6848\u4f8b\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=demo-report.html\n    \n    #\u5176\u4ed6\u914d\u7f6e\u53c2\u6570\n    --template=3, \u6d4b\u8bd5\u62a5\u544a\u6a21\u677f\u9009\u62e9(1,2,3)\n    --report=/*/*.html, \u62a5\u544a\u751f\u6210\u7edd\u5bf9\u8def\u5f84\n    --history_dir=history.json\u7684\u76ee\u5f55\u8def\u5f84,\u9ed8\u8ba4\u4f7f\u7528html\u6587\u4ef6\u540c\u7ea7\u76ee\u5f55\n    --title=\u6d4b\u8bd5\u62a5\u544a\u6807\u9898, \u56de\u586b\u5230\u62a5\u544a\n    --tester=\u6d4b\u8bd5\u4eba\u5458,\u56de\u586b\u5230\u62a5\u544a\n    --desc=\u6d4b\u8bd5\u6784\u5efa\u63cf\u8ff0,\u56de\u586b\u5230\u62a5\u544a\n    --log_path=\u6d4b\u8bd5\u65e5\u5fd7\u8def\u5f84, \u56de\u586b\u5230\u62a5\u544a(template=3)\n    --report_path=\u6d4b\u8bd5\u62a5\u544a\u8be6\u60c5\u8def\u5f84, \u56de\u586b\u5230\u62a5\u544a(template=3)\n    --testcase_basename=\u6d4b\u8bd5\u7528\u4f8broot-dir basename, \u4f9b\u904d\u5386__init__.py\u67e5\u627e\u6a21\u5757\u540d(template=3)\n    \n    # \u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u53c2\u6570\n    pytest --report=report.html --history_dir=./reports --title=\u6d4b\u8bd5\u62a5\u544a --tester=txu --desc=\u9879\u76ee\u63cf\u8ff0\n    ```\n    \n- ###### pytest.main\u6267\u884c\n\n    ```shell\n    import pytest\n    \n    pytest.main(['--report=demo-report.html',\n                 '--history_dir=./reports',\n                 '--title=\u6d4b\u8bd5\u62a5\u544a\u6807\u9898',\n                 '--tester=txu',\n                 '--desc=\u62a5\u544a\u63cf\u8ff0\u4fe1\u606f'])\n    ```\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "1.2.6",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a2382185570469eb1c35b687cbb3ce88dca7fbab24e08a98c89867bafe4d65ed",
                "md5": "95330d169ebfa15b171fa9c2176fae8e",
                "sha256": "2a56700bcb4d09fcc19fca978764481bcffbeabf3a7838b4d043784299483773"
            },
            "downloads": -1,
            "filename": "pytest_flexreport-1.2.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "95330d169ebfa15b171fa9c2176fae8e",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.5",
            "size": 253464,
            "upload_time": "2023-04-15T05:45:52",
            "upload_time_iso_8601": "2023-04-15T05:45:52.992406Z",
            "url": "https://files.pythonhosted.org/packages/a2/38/2185570469eb1c35b687cbb3ce88dca7fbab24e08a98c89867bafe4d65ed/pytest_flexreport-1.2.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2f772fae779525450b082b9b4b99b2cca6a396883308859f1e56c881850c8d00",
                "md5": "5fde19fa400ce492c2c9259509eb4e30",
                "sha256": "d724a4b3f7055a7134120f91bdd4070f15ecfbe94be6509b1ba844f1e28f70ca"
            },
            "downloads": -1,
            "filename": "pytest-flexreport-1.2.6.tar.gz",
            "has_sig": false,
            "md5_digest": "5fde19fa400ce492c2c9259509eb4e30",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 247945,
            "upload_time": "2023-04-15T05:45:55",
            "upload_time_iso_8601": "2023-04-15T05:45:55.309556Z",
            "url": "https://files.pythonhosted.org/packages/2f/77/2fae779525450b082b9b4b99b2cca6a396883308859f1e56c881850c8d00/pytest-flexreport-1.2.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-15 05:45:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "txu2k8",
    "github_project": "pytest-flexreport",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "appveyor": true,
    "requirements": [],
    "tox": true,
    "lcname": "pytest-flexreport"
}
        
TXU
Elapsed time: 0.06648s