Skip to main content

Multtestlib, a package developed for performing unit tests in Python using parallel processing.

Project description

multtestlib: A package developed for performing unit tests in Python using parallel processing.

Multtestlib has been devised to aid Python testers in expediting their testing processes through non-distributed parallel processing. This approach allows customizable utilization of the computer's available processor cores, facilitating workload distribution and consequent reduction in the overall execution time of the test suite.


Installation

Multtestlib is available on PyPi and can be installed using the pip command:

pip install multtestlib

Requirements

Multtestlib requires Python 3.7 or later to run.


Usage

For parallel processing usage, the input parameters of the test functions and their respective expected values must be stored in lists. During the test processing, multtestlib will take care of distributing and managing the data contained in the lists - and functions - among the processor cores indicated in the test program.

Next, we will see an example of a unit test for the myfunction(a, b) being submitted for execution using parallel processing:

import multtestlib as mtl
import functions

def main():
    cpus = 8 # Specify the number of CPUs to be used.
    input_values1 = []
    input_values2 = []
    return_values = []
	
    # It is necessary to store the input data and
    # expected values in their respective lists.

    mtl.test_equal(cpus, input_values1, input_values2, return_values, functions.myfunction)


if __name__ == "__main__":
    mtl.init()
    main()
    mtl.end()

Output Files

During the execution of the unit tests, three output files are generated containing the results of the tests performed.

filepass.txt -> Contains passed tests
filefail.txt -> Contains failed tests
filetot.txt -> Contains all tests

List of testing commands

table


MIT License

Copyright (c) 2022-2024 Ricardo Ribeiro de Alvarenga

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

multtestlib-1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

multtestlib-1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file multtestlib-1.0.tar.gz.

File metadata

  • Download URL: multtestlib-1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for multtestlib-1.0.tar.gz
Algorithm Hash digest
SHA256 92bb9ef61b312d12d0e4d880e14ad2cfed1aa653a0a9bcb1d0b4ec3a7a3cd4dc
MD5 67d5634f6045f0539c071f058d3ad2c8
BLAKE2b-256 f5fc98eb174e070ce0212e0858e8164b537b8a572c3800e32a9f1a0afa447197

See more details on using hashes here.

File details

Details for the file multtestlib-1.0-py3-none-any.whl.

File metadata

  • Download URL: multtestlib-1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for multtestlib-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6fc5d23764395df3e647b4efa88d6b60f0f7db9ecafbc53ceb0909d9164a01a
MD5 f9fa163b761973ed24d0b5153fc0d52d
BLAKE2b-256 7df1c98cee78dee6731899bd9a1b08d8ac156b25fe7cd60540d54bdb1c0d4603

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