Skip to main content

unittest enhancement

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unitplus-0.1.2.tar.gz (16.5 kB view details)

Uploaded Source

File details

Details for the file unitplus-0.1.2.tar.gz.

File metadata

  • Download URL: unitplus-0.1.2.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for unitplus-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5a2404b769c254ad597c31b944f0849def8c72a1fa3bd56ce305af25a8ca06c5
MD5 87e02ce905007b22b692fc63405a2bb8
BLAKE2b-256 48ef80d93f4ebba2c4ce1c16784eb64d2fcb8d1bf2742fe6e03d6cad1daad8e5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page