Skip to main content
🍋test /ˈlɛmən tɛst/ Noun.
 1. A test which appears to test a feature, but in fact does not test that feature at all.
 [us. I reviewed that pull request and found one 🍋test that doesn't test right.]

What?

A unittest runner for detecting 🍋tests.

Why?

Good development practice dictates that new features should be accompanied with new tests. Good tests can identify regressions and accidental removal of features.

A 🍋test, is a test which appears to test a feature, but in fact does not test that feature at all. 🍋tests can be considered worse than not having a test at all, because they give the false assumption that your new feature is tested. If a regression occurs, 🍋tests won’t let you know. The detection of 🍋tests can identify situations when the feature does not meet your requirements. Detecting 🍋tests helps ensure code quality and feature delivery.

This library identifies 🍋tests. This is done by examining two git branches: the feature, and the merge destination. The algorithm separates business logic from testing code, and then uses Git to revert business logic to it’s previous state (the same as the merge destination). A test suite is then run on the reverted business logic with the new tests. Any tests that are successful are marked as 🍋tests.

Testing for 🍋tests is a form of mutation testing. The mutation operation in this case is reverting the business logic to it’s previous state before the feature was written.

Quickstart

pip install lemontest
manage.py test --testrunner=lemontest.djangorunner.DjangoLemonTestRunner --to-branch=master --from-branch=feature/123

It must be a git repository.

Lemontest needs a git repository to be able to revert business logic.

Travis CI

Travis conveniently provides environment variables we can use.

pip install lemontest
manage.py test --testrunner=lemontest.djangorunner.DjangoLemonTestRunner --to-branch=$TRAVIS_BRANCH --from-branch=$TRAVIS_PULL_REQUEST_SHA

Algorithm

  1. Get source files that have changed (git diff)

  2. Identify test source files (use unittest discovery and intersect with step 1)

  3. Identify business logic files (set difference between step 1 and step2)

  4. Use git to revert business logic code (git checkout)

  5. Run tests that have changed

  6. Raise an exception for each test that succeeds

Metadata

Release files for lemontest 0.4.6

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

Source distribution (sdist)

Source distribution for lemontest 0.4.6
File Size Uploaded Provenance Actions
lemontest-0.4.6.tar.gz 7.4 kB Without provenance Details for lemontest-0.4.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lemontest 0.4.6
File Interpreter ABI Platform Actions
lemontest-0.4.6-py2.py3-none-any.whl Python 3, Python 2 none any Details for lemontest-0.4.6-py2.py3-none-any.whl

Total release size: 15.5 kB

Release files / lemontest-0.4.6.tar.gz

Download URL lemontest-0.4.6.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
09cc9c88b9d0c573b9d02203683d140ff87bfa6504be2b4a00674428f3bffa91
BLAKE2b-256 checksum
How to use checksums
44e25209996b5948bc109d093e04693d17ab73e6071d24d4c33bd7daca54c356
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release files / lemontest-0.4.6-py2.py3-none-any.whl

Download URL lemontest-0.4.6-py2.py3-none-any.whl
Size 8.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3c45028f37f9b3d7b46b58e52e182d71652eecf3986d2b3d09c018df3124235b
BLAKE2b-256 checksum
How to use checksums
21f1e124fe5b62be0e2317fc766cc178ae06eebf4a6d952590977ee04bd30872
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Security for lemontest 0.4.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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