Skip to main content

Python utilities to perform dryrun.

Project description

The module helps you to implement dryrun mode in your Python projects with an easy switch ‘on/off’ feature.

Authors:

Daniele Zanotelli (dazano@gmail.com)

Contributors:

sakshilucky25

Copyright:

2017-2025

License:

MIT

Python version:

3.x

Documentation

The package is supplied with Sphinx compilable documentation under the docs directory.

You can read the latest docs visiting the project docs online.

Installation

Via pip:

$ pip install drypy

or download the project from the github and compile the package

$ git clone https://github.com/dzanotelli/drypy.git
$ cd drypy
$ make whl

and you’ll find your brand-new whl under the dist/ subdirectory.

Basic usage

Apply the sham decorator to your function and set dryrun as on.

from drypy import dryrun
from drypy.patterns import sham

>>> @sham
>>> def foo(bar):
        pass
>>> dryrun(True)
>>> foo(42)

Will log the following output:

[DRYRUN] call to 'foo(42)'

using the python standard logging facility, thus it’s up to you to correctly configure it (check the docs for a working example).

To use custom substitutes with specific beahviours please search in the docs for the sheriff-deputy pattern.

Tests

To run the test suite just use the basic unittest syntax:

::

$ python -m unittest drypy/tests.py

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

drypy-1.2.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drypy-1.2.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file drypy-1.2.0.tar.gz.

File metadata

  • Download URL: drypy-1.2.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for drypy-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c26a9395ce5e16bca1bb29571a650615d327cb2adbc59f0d16204fdd540f7533
MD5 c3a2bed9598c4e173f6dfe3ca7f2041e
BLAKE2b-256 e1f5d0eb052543c130db48b1361fcace37bcbdd31f7fee37130673801a62f8de

See more details on using hashes here.

File details

Details for the file drypy-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: drypy-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for drypy-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a79a9cb6a3b91ad82b49fb84aae9fb9e951396c93dd9c48daddd68641984e6da
MD5 89b16d98b40e19f614ce334a064fc0e4
BLAKE2b-256 84f34fedcc4569f747993a4c907667cad454679f3ca6037cd8de7e7885eb98e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page