unitplus


Nameunitplus JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/hanzhichao/unitplus
Summaryunittest enhancement
upload_time2024-08-19 09:26:02
maintainerNone
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

![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)

Enhancement for unittest by adding status, priority, tags, owner properties for testcases and filters.


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

### Simple Use
#### Write TestCase
```python
import unitplus


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

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

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

if __name__ == '__main__':
    unitplus.main()
```

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


class TestPlanDemo(unitplus.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": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "unitplus",
    "author": "Han Zhichao",
    "author_email": "superhin@126.com",
    "download_url": "https://files.pythonhosted.org/packages/48/ef/80d93f4ebba2c4ce1c16784eb64d2fcb8d1bf2742fe6e03d6cad1daad8e5/unitplus-0.1.2.tar.gz",
    "platform": null,
    "description": "# unitplus\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\nEnhancement for unittest by adding status, priority, tags, owner properties for testcases and filters.\n\n\n## Install\n```shell\npip install unitplus\n```\n\n### Simple Use\n#### Write TestCase\n```python\nimport unitplus\n\n\nclass TestDemo(unitplus.TestCase):\n    priority = 'p1'\n    status = 'ready'\n    owner = 'superhin'\n    iteration = 'v0.1.0'\n    tags = ['demo']\n\n    @unitplus.test(title='test demo a', priority='p2')\n    def test_a(self):\n        self.logger.info('a demo test case')\n\n    @unitplus.test(title='test ddt with data',data=['a', 'b', 'c'])\n    def test_b(self, item):\n        self.logger.info('item =', item)\n\nif __name__ == '__main__':\n    unitplus.main()\n```\n\n### Use TesPlan  to run tests\n```python\nimport unitplus\n\n\nclass TestPlanDemo(unitplus.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.2",
    "project_urls": {
        "Homepage": "https://github.com/hanzhichao/unitplus"
    },
    "split_keywords": [
        "unitplus"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48ef80d93f4ebba2c4ce1c16784eb64d2fcb8d1bf2742fe6e03d6cad1daad8e5",
                "md5": "87e02ce905007b22b692fc63405a2bb8",
                "sha256": "5a2404b769c254ad597c31b944f0849def8c72a1fa3bd56ce305af25a8ca06c5"
            },
            "downloads": -1,
            "filename": "unitplus-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "87e02ce905007b22b692fc63405a2bb8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16479,
            "upload_time": "2024-08-19T09:26:02",
            "upload_time_iso_8601": "2024-08-19T09:26:02.867921Z",
            "url": "https://files.pythonhosted.org/packages/48/ef/80d93f4ebba2c4ce1c16784eb64d2fcb8d1bf2742fe6e03d6cad1daad8e5/unitplus-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-19 09:26:02",
    "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.31323s