Python Nested Function Set In Real Python Pytest Assert