unitplus


Nameunitplus JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/hanzhichao/unitplus
Summaryunittest enhancement
upload_time2023-07-19 07:14:18
maintainer
docs_urlNone
authorHan Zhichao
requires_python>=3.6
licenseMIT license
keywords unitplus
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # unitplus
Enhancement for unittest


![Languate - Python](https://img.shields.io/badge/language-python-blue.svg)
![PyPI - License](https://img.shields.io/pypi/l/unitplus)
![PyPI](https://img.shields.io/pypi/v/unitplus)
![PyPI - Downloads](https://img.shields.io/pypi/dm/unitplus)


## Install
```shell
pip install unitplus
```

## Simple Use
> Document: <https://python-yapi.readthedocs.io/en/latest/>

> 中文文档: <https://python-yapi.readthedocs.io/zh_CN/latest/>

### Register and Login
```python
from python_yapi import YApi
yapi = YApi(base_url='http://localhost:3000')

username, email, password = 'Kevin', 'kevin@126.com', 'abc123'

yapi.register(username, email, password)  # return a dict
yapi.login( email, password) # return a dict
```


### Simple Use
#### Write TestCase
```python
from unitplus import TestCase, test


class TestDemo(TestCase):
    priority = 'p1'
    status = 'ready'
    owner = 'superhin'
    iteration = 'v0.1.0'
    tags = ['demo']

    @test(title='test demo a', priority='p2')
    def test_a(self):
        self.logger.info('a demo test case')

    @test(title='test ddt with data',data=['a', 'b', 'c'])
    def test_b(self, item):
        self.logger.info('item =', item)
```

### Use TesPlan  to run tests
```python
from unitplus import TestPlan


class TestPlanDemo(TestPlan):
    # test names for suite
    tests = [
        'cases.testdemo',
    ]

    # filter tests by attributes
    filter = {
        'priorities': ['p0', 'p1'],
        'status': ['ready'],
        'tags': ['demo'],  # include tags
        'exclude_tags': ['post'],
        'exclude_names': [
            'cases.test_case3.TestA.test_get03',
            'cases.test_case4.TestA.test_get02',
        ]

    }


if __name__ == '__main__':
    # run suite , supporting multiple threads
    TestPlanDemo().run(verbosity=3)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hanzhichao/unitplus",
    "name": "unitplus",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "unitplus",
    "author": "Han Zhichao",
    "author_email": "superhin@126.com",
    "download_url": "https://files.pythonhosted.org/packages/ae/cd/83ba90e1904104e0ec6189388611083798d118dd128b35cad2b63033ca9a/unitplus-0.1.0.tar.gz",
    "platform": null,
    "description": "# unitplus\nEnhancement for unittest\n\n\n![Languate - Python](https://img.shields.io/badge/language-python-blue.svg)\n![PyPI - License](https://img.shields.io/pypi/l/unitplus)\n![PyPI](https://img.shields.io/pypi/v/unitplus)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/unitplus)\n\n\n## Install\n```shell\npip install unitplus\n```\n\n## Simple Use\n> Document: <https://python-yapi.readthedocs.io/en/latest/>\n\n> \u4e2d\u6587\u6587\u6863: <https://python-yapi.readthedocs.io/zh_CN/latest/>\n\n### Register and Login\n```python\nfrom python_yapi import YApi\nyapi = YApi(base_url='http://localhost:3000')\n\nusername, email, password = 'Kevin', 'kevin@126.com', 'abc123'\n\nyapi.register(username, email, password)  # return a dict\nyapi.login( email, password) # return a dict\n```\n\n\n### Simple Use\n#### Write TestCase\n```python\nfrom unitplus import TestCase, test\n\n\nclass TestDemo(TestCase):\n    priority = 'p1'\n    status = 'ready'\n    owner = 'superhin'\n    iteration = 'v0.1.0'\n    tags = ['demo']\n\n    @test(title='test demo a', priority='p2')\n    def test_a(self):\n        self.logger.info('a demo test case')\n\n    @test(title='test ddt with data',data=['a', 'b', 'c'])\n    def test_b(self, item):\n        self.logger.info('item =', item)\n```\n\n### Use TesPlan  to run tests\n```python\nfrom unitplus import TestPlan\n\n\nclass TestPlanDemo(TestPlan):\n    # test names for suite\n    tests = [\n        'cases.testdemo',\n    ]\n\n    # filter tests by attributes\n    filter = {\n        'priorities': ['p0', 'p1'],\n        'status': ['ready'],\n        'tags': ['demo'],  # include tags\n        'exclude_tags': ['post'],\n        'exclude_names': [\n            'cases.test_case3.TestA.test_get03',\n            'cases.test_case4.TestA.test_get02',\n        ]\n\n    }\n\n\nif __name__ == '__main__':\n    # run suite , supporting multiple threads\n    TestPlanDemo().run(verbosity=3)\n```\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "unittest enhancement",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/hanzhichao/unitplus"
    },
    "split_keywords": [
        "unitplus"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f851bfc19997f7a31dcdc26698fb8d60ab4da52dd442875797bf8b1509e69b2",
                "md5": "d3451fb3b7ed44fdbe61f37bd32c1105",
                "sha256": "ec38cf4f3dcaac36a4974f17a2e9fc9d0402c0638b7705abcf7eb70089c993fe"
            },
            "downloads": -1,
            "filename": "unitplus-0.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d3451fb3b7ed44fdbe61f37bd32c1105",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 11758,
            "upload_time": "2023-07-19T07:14:16",
            "upload_time_iso_8601": "2023-07-19T07:14:16.644146Z",
            "url": "https://files.pythonhosted.org/packages/1f/85/1bfc19997f7a31dcdc26698fb8d60ab4da52dd442875797bf8b1509e69b2/unitplus-0.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aecd83ba90e1904104e0ec6189388611083798d118dd128b35cad2b63033ca9a",
                "md5": "3120240eb824e1213815bba9985d5a15",
                "sha256": "037fddc6ab60fb872249f60254cd9849658ad8fd560359228ee6f07fe326d3b7"
            },
            "downloads": -1,
            "filename": "unitplus-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3120240eb824e1213815bba9985d5a15",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16782,
            "upload_time": "2023-07-19T07:14:18",
            "upload_time_iso_8601": "2023-07-19T07:14:18.558336Z",
            "url": "https://files.pythonhosted.org/packages/ae/cd/83ba90e1904104e0ec6189388611083798d118dd128b35cad2b63033ca9a/unitplus-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-19 07:14:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hanzhichao",
    "github_project": "unitplus",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "unitplus"
}
        
Elapsed time: 0.08812s