In the document: https://pytest-with-eric.com/mocking/mocking-vs-patching/
The source tree is wrong:
.
├── .gitignore
├── pytest.ini
├── README.md
├── requirements.txt
├── tests
│ └── cat_api.py
└── src
├── init.py
└── test_cat_api.py
cat_api.py should be in src folder, and test_cat_api.py should be in tests folder.