执行dryrun的python实用程序。
dryp的Python项目详细描述
该模块帮助您在 python项目具有一个简单的开关“开/关”特性。
Authors: | Daniele Zanotelli (dazano@gmail.com) |
---|---|
Copyright: | 2017-2018 |
License: | MIT |
Python version: | 3.x |
安装
通过PIP:
$ pip install drypy
或者从github下载项目并编译包
$ git clone https://github.com/dzanotelli/drypy.git $ cd drypy $ make whl
你会在dist/子目录下找到你的全新whl。
基本用法
将shamdecorator应用于函数并将dryrun设置为on。
from drypy import dryrun from drypy.patterns import sham >>> @sham >>> def foo(bar): pass >>> dryrun(True) >>> foo(42)
将记录以下输出:
[DRYRUN] call to 'foo(42)'
使用python标准日志工具,因此由您决定 以正确配置它。
若要使用特定海鸟的自定义替代品,请查看警长副手模式的文档。