Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In python, is it possible to check if there are any and how many side effects are remaining?

For example:

mocked_foo = patch.object(Foo, 'method', side_effects=[1, 2, 3])

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
143 views
Welcome To Ask or Share your Answers For Others

1 Answer

this reads the number of digits in the variable.

n=int(input(mocked_foo))
count=0
while(n>0):
    count=count+1
    n=n//10
print("The ammount of sideeffects left are:",count)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...