Skip to main content

microtest

Simple but powerful testing framework for Python.


Installation

python -m pip install microtest-framework

On Mac and Linux microtest doesn't require any external dependencies. On Windows colorama is used to translate ANSI escape sequences to win32 calls.

Microtest currently requires Python version 3.7 or higher.


Usage

Here's the simplest testing program you can create with microtest:

import microtest


@microtest.test
def function():
    x = 10
    assert x < 0
    

if __name__ == '__main__':
    microtest.run()

You can run this script normally via the command line:

python test.py

The script will produce the following output:

======================================================================
Started testing...
======================================================================
function ..................................................... FAILED

AssertionError on line 7:
assert 10 < 0 


----------------------------------------------------------------------
Ran 1 tests in 0.001s.

ERRORS: 0
FAILED: 1

Documentation

Full source code refrence and user guide can be found here.


Contributing

To contribute new features to this project do the following steps:

  • Open a new issue explaining the new feature
  • Wait for approval
  • Fork and clone the repository to your local machine and code up the feature in a new branch
  • Pull request

The wait for approval step is there so that you don't end up coding up some feature that might not be included into microtest. This could happen if the proposed feature is redundant, changes the existing api too radically, or simply just is not the right thing to be added into microtest.

The goal is to keep this project simple and small.

Bug fixes, documentation improvements and other minor tweaks are always welcome, no need for approval. Just leave a pull request with the fixes done in a separate branch.

Release files for microtest-framework 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microtest-framework 1.0.1
File Size Uploaded
microtest-framework-1.0.1.tar.gz 17.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for microtest-framework 1.0.1
File Interpreter ABI Platform
microtest_framework-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / microtest-framework-1.0.1.tar.gz

Download URL microtest-framework-1.0.1.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aa000d668395d21b5fe8d82f1b7c7066c3017154be9657ad027702513088f37a
BLAKE2b-256 checksum
How to use checksums
ecbecf202a3dfcf2507099ed0bc1b7e6094dd7db12b34d2e0de558004c06f1d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.0.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / microtest_framework-1.0.1-py3-none-any.whl

Download URL microtest_framework-1.0.1-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67f16578f3aab16acf463800fb73c115ea03a602bbf5e5096b916e36d08a795e
BLAKE2b-256 checksum
How to use checksums
7d3b34e6ed0a90685ea6dfb9bfe915cf6e4c518a4d7987bc52eb9f29843718f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.0.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page