Skip to main content

unitplus

Languate - Python PyPI - License PyPI PyPI - Downloads

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

Install

pip install unitplus

Simple Use

Write TestCase

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

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)

Metadata

Release files for unitplus 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unitplus 0.1.2
File Size Uploaded
unitplus-0.1.2.tar.gz 16.5 kB Details

Release files / unitplus-0.1.2.tar.gz

Download URL unitplus-0.1.2.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5a2404b769c254ad597c31b944f0849def8c72a1fa3bd56ce305af25a8ca06c5
BLAKE2b-256 checksum
How to use checksums
48ef80d93f4ebba2c4ce1c16784eb64d2fcb8d1bf2742fe6e03d6cad1daad8e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page