System test framework with serial and parallel execution.
Project description
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.
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.debug("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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file systest-1.4.0.tar.gz
.
File metadata
- Download URL: systest-1.4.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc6534a6bf11264f775bee666365b53b74ae441f75ef89c6238c7811c19c9e0c |
|
MD5 | 010bde996f8015cccfd02cd77084aef8 |
|
BLAKE2b-256 | 23d962d6fdddc4cf2a845a7289fdc56f9b8744b94e060290afbbdf3f5da0dec7 |
File details
Details for the file systest-1.4.0-py2.py3-none-any.whl
.
File metadata
- Download URL: systest-1.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 987b3732298fe1c99d1744c220957e78cae2878d74b9407ce89faea4d41ce1f0 |
|
MD5 | 786e228a08daa9ba0db6ce72baba5927 |
|
BLAKE2b-256 | a8608888a1821e2eb0538b51174fd712cf010f52f5e529357580bce3fef79cec |