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 integration/system test in mind. The framework is not indended as a replacement for unittest, but rather to be a complement to it.

Documentation: http://systest.readthedocs.org/en/latest

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.

import logging
from systest import TestCase, Sequencer, configure_logging

LOGGER = logging.getLogger(__name__)

# Define a testcase.
class MyTestCase(TestCase):

    def __init__(self, name):
        super(MyTestCase, self).__init__()
        self.name = "my_testcase_" + name

    def run(self):
        LOGGER.info("Hello!")

# Configure the logging module.
configure_logging()

sequencer = Sequencer("my_sequence")

# Run the sequence.
sequencer.run([
        MyTestCase("1"),
        (
            MyTestCase("2"),
            [
                MyTestCase("3"),
                MyTestCase("4")
            ]
        ),
        MyTestCase("5")
    ])

# Print the report.
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
Hello!

my_testcase_1: PASSED in 0m 0s
---------------------------------------------------------------
Name: my_testcase_2
Description:
None
Hello!

my_testcase_2: PASSED in 0m 0s
---------------------------------------------------------------
Name: my_testcase_3
Description:
None
Hello!

my_testcase_3: PASSED in 0m 0s
---------------------------------------------------------------
Name: my_testcase_4
Description:
None
Hello!

my_testcase_4: PASSED in 0m 0s
---------------------------------------------------------------
Name: my_testcase_5
Description:
None
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-3.4.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

systest-3.4.0-py2.py3-none-any.whl (9.4 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for systest-3.4.0.tar.gz
Algorithm Hash digest
SHA256 a7d24ed1b23d4f72f190fabcf38079767ae422be9bb425ff1c82d8636b39f8f4
MD5 47d9f4912169988e8e5c13f0557aa673
BLAKE2b-256 8340fff841df59df6d4f675e69b8384bc2f45d1d841299888dc34755f152dd3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for systest-3.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 66d7562f36e9db325589fcdeb3445d3722c9e88654f340efb62f1de7891eee88
MD5 57df9fe23757f8b7ea63e96280cf8055
BLAKE2b-256 13e4b927db4d29b3fb4e34ec2847e0425ecc813e6da58bb12f1d5e92b80df9be

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