Tag: pytest (2 posts)
🇺🇸![How to use functions as Mocks in Python tests](/_astro/test-labs.BtNb7-6-_ee0No.webp)
How to use functions as Mocks in Python tests
Useful for avoid calling real APIs or services
#python#testing#mocking#pytest
![Mocking global variables in Python tests](/_astro/python-global-envs.CuCY2oPJ_1BW2nH.webp)
Mocking global variables in Python tests
I was trying to test some global variables with Python, specially for a script which contain global variables. And after trying and failing I think that I can show you the most simple version to do it.
#python#mocking#pytest