Witam mam problem z zamockowaniem funkcji.
#app.py
from time import sleep
def is_windows():
sleep(5)
return True
def get_operating_system():
return 'Windows' if is_windows() else 'Linux'
#test_app.py
from app import get_operating_system
def test_get_operating_system(mocker):
mocker.patch('insert_to_tmp.is_windows', return_value=True)
assert get_operating_system() == 'Windows'
Problem jest taki, że pomimo dodania mocker.patch testy nadal czekaja 5 sekund... A powinny trwać milisekundy