lucashadfield / argument_randomiser

tools to support annotating functions and classes to extend their functionality to accept randomisers as arguments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

argument_randomiser

from argument_randomiser import randargs, IntRandomiser

@randargs()
def func(a, b):
    return a + b

i = IntRandomiser(0, 5)
j = IntRandomiser(5, 10)

print(func(a=i, b=j))
print(func(a=i, b=j))
print(func(a=i, b=j))
11
13
7

func.call_history
>> [{a: 3, b: 8}, {a: 4, b: 9}, {a: 1, b: 6}]

About

tools to support annotating functions and classes to extend their functionality to accept randomisers as arguments

License:GNU General Public License v3.0


Languages

Language:Python 100.0%