Skip to main content

Complete documentation is available at http://farmdev.com/projects/fudge/

Fudge is a Python module for using fake objects (mocks and stubs) to test real ones.

In readable Python code, you declare what methods are available on your fake and how they should be called. Then you inject that into your application and start testing. This declarative approach means you don’t have to record and playback actions and you don’t have to inspect your fakes after running code. If the fake object was used incorrectly then you’ll see an informative exception message with a traceback that points to the culprit.

Here is a quick preview of how you can test code that sends email without actually sending email:

@fudge.patch('smtplib.SMTP')
def test_mailer(FakeSMTP):
    # Declare how the SMTP class should be used:
    (FakeSMTP.expects_call()
             .expects('connect')
             .expects('sendmail').with_arg_count(3))
    # Run production code:
    send_mail()
    # ...expectations are verified automatically at the end of the test

Metadata

Release files for fudge-je 1.0.3

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

Source distribution (sdist)

Source distribution for fudge-je 1.0.3
File Size Uploaded Provenance
fudge-je-1.0.3.tar.gz 87.4 kB Without provenance Details

Release files / fudge-je-1.0.3.tar.gz

Download URL fudge-je-1.0.3.tar.gz
Size 87.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a856a04e547b44812393ff3ed254877545624a579ccd4f9b4b08e55869affd8c
BLAKE2b-256 checksum
How to use checksums
f7a9c3ae49f58c764eaf9b02ee14566f032955d287c5f0fc7cbe1859371ada45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for fudge-je 1.0.3

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.

Release history Release notifications | RSS feed

This release

1.0.3 This release

1 release file No provenance

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