Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def helloworld():
- return "hello world"
- def helloworld_helper():
- return helloworld()
- import mylibrarywithlongname as ml
- from mock import MagicMock
- def test():
- ml.helloworld = MagicMock(return_value="oops")
- print(ml.helloworld_helper())
- print(ml.helloworld_helper())
- test()
- print(ml.helloworld_helper())
- hello world
- oops
- oops
Add Comment
Please, Sign In to add comment