Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to spy on regular functions. #97

Closed
eirnym opened this issue Jan 2, 2018 · 1 comment
Closed

Add ability to spy on regular functions. #97

eirnym opened this issue Jan 2, 2018 · 1 comment

Comments

@eirnym
Copy link

eirnym commented Jan 2, 2018

Please, add ability to spy on regular functions too.

new_fun = mocker.spy('random.randint')
...
new_fun.assert_called_once_with(10, 20)
@nicoddemus
Copy link
Member

Hi, sorry for the delay!

It already works, you just have to pass object and name:

new_fun = mocker.spy(random, 'randint')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants