Skip to main content

System test framework with serial and parallel execution.

Project description

buildstatus

Installation

pip install systest

Description

Execute a sequence of test cases in serial and/or parallel.

Test cases in a list are executed in serial and test cases in a tuple are executed in parallel in separate Python threads.

This framework is created with production test in mind, trying to make it possible to minimize the test execution time by executing tests in parallel. The framework is not indended as a replacement for unittest, but rather to be a complement to it.

Example usage

See the test suite: https://github.com/eerimoq/systest/blob/master/tests/test_systest.py

For example, the sequence below starts with test case MyTestCase("1"). When MyTestCase("1") has been executed, MyTestCase("2") and the list of MyTestCase("3") and MyTestCase("4") are executed in parallel. When both MyTestCase("2") and the list of MyTestCase("3") and MyTestCase("4") has been executed, MyTestCase("5") is executed. Then the sequence ends.

from systest import TestCase, Sequencer

class MyTestCase(TestCase):
    def __init__(self, name):
        super(MyTestCase, self).__init__()
        self.name = "my_testcase_" + name
    def run(self):
        self.log("Hello!")

sequencer = Sequencer("my_sequence")

sequencer.run([
        MyTestCase("1"),
        (
            MyTestCase("2"),
            [
                MyTestCase("3"),
                MyTestCase("4")
            ]
        ),
        MyTestCase("5")
    ])

sequencer.report()

The output is:

Name: my_sequence
Date: 2016-02-02 18:42:40.446213
Node: erik-VirtualBox
User: erik
---------------------------------------------------------------
Name: my_testcase_1
Description:
None
2016-02-02 18:42:40.488127 my_testcase_1 Hello!

my_testcase_1: PASSED in 0m 0s
---------------------------------------------------------------
Name: my_testcase_2
Description:
None
2016-02-02 18:42:40.490369 my_testcase_2 Hello!

my_testcase_2: PASSED in 0m 0s
---------------------------------------------------------------
Name: my_testcase_3
Description:
None
2016-02-02 18:42:40.491976 my_testcase_3 Hello!

my_testcase_3: PASSED in 0m 0s
---------------------------------------------------------------
Name: my_testcase_4
Description:
None
2016-02-02 18:42:40.494298 my_testcase_4 Hello!

my_testcase_4: PASSED in 0m 0s
---------------------------------------------------------------
Name: my_testcase_5
Description:
None
2016-02-02 18:42:40.496103 my_testcase_5 Hello!

my_testcase_5: PASSED in 0m 0s

---------------------- Test summary begin ----------------------

[
    [
        my_testcase_1: PASSED,
        (
            my_testcase_2: PASSED,
            [
                my_testcase_3: PASSED,
                my_testcase_4: PASSED
            ]
        ),
        my_testcase_5: PASSED
    ]
]

Execution time: 0m 0s

----------------------- Test summary end -----------------------

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

systest-0.5.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

systest-0.5.0-py2.py3-none-any.whl (7.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file systest-0.5.0.tar.gz.

File metadata

  • Download URL: systest-0.5.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for systest-0.5.0.tar.gz
Algorithm Hash digest
SHA256 788a5e5b52e5f90e7b5a5531506d77b52e0e618700b551dc1772a05b55fb597c
MD5 b6320972fce88b985f7e3be1d37b7215
BLAKE2b-256 b6bfdc77dd862683f741f467f4f2868f2872e2f021add9ec3106188be4f2b07e

See more details on using hashes here.

File details

Details for the file systest-0.5.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for systest-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3ee353ef0cc5ba36459c4a07b74d335fd7e283558f69c819765f30ca3c3265a2
MD5 4d3985de083db24c987dae6705123469
BLAKE2b-256 e65417bb655231ccce0d5400cdb7fdbb3850adaf3d948f4ae990983b52c2e015

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