Skip to main content

Library

Project description

Regress

codecov Documentation Status Maintainability

Regression testing framework for Python 3.4+. It's useful in unit and module testing when creating or rewriting test data is too boring. After you canonized the ideal output result all tests will pass until the data changes moment.

  • Writes data to the local filesystem storage
  • Supports binary, text, json and picklable objects
  • Different policies for resolving test conflicts

Currently integrates best with the PyTest, but other frameworks are also welcomed.

Example

One pytest function is the scope of the result. Newly calculated data compares with the original canonized result.

# regress is the function scope helper fixture easy to setup
def test_simple(regress: RegressFixture):
    result = {'a': 1}
    regress.test(result)  # Commit first time

    result2 = {'a': 1}
    regress.test(result2)  # Ok. No object result changes

    result3 = {'a': 3}  # Try commit change. Raised the AssertionError
    with pytest.raises(AssertionError) as e:
        regress.test(result3)

To continue exploring you can visit the quickstart.

Using

pip3 install regress

Documentation

https://regress.readthedocs.io/

Development

Making virtualenv with development requirements:

python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install -r requirements.txt

Testing

venv/bin/pytest -s tests
venv/bin/flake8 regress --show-source --statistics
venv/bin/pytest --cov=regress --cov-report html

Or for automatizing:

cp TEST.sh.example TEST.sh
chmod +x TEST.sh
./TEST.sh

Some tests uses console for user interaction. Add --canonize flag:

venv/bin/pytest -s tests --canonize

Building docs

Using sphinx:

cd docs
make

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for regress, version 0.0.4
Filename, size File type Python version Upload date Hashes
Filename, size regress-0.0.4.tar.gz (9.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page