Enhance test assertions with detailed error messages

This commit is contained in:
2025-01-23 20:18:27 +01:00
parent bf5c08346e
commit 93d2e54e97
6 changed files with 158 additions and 68 deletions

View File

@ -5,9 +5,11 @@ from discord_reminder_bot import main
def test_if_send_to_discord_is_in_main() -> None:
"""send_to_discords needs to be in main for this program to work."""
assert hasattr(main, "send_to_discord")
assert_msg: str = f"send_to_discord is not in main. Current functions in main: {dir(main)}"
assert hasattr(main, "send_to_discord"), assert_msg
def test_if_send_to_user_is_in_main() -> None:
"""send_to_user needs to be in main for this program to work."""
assert hasattr(main, "send_to_user")
assert_msg: str = f"send_to_user is not in main. Current functions in main: {dir(main)}"
assert hasattr(main, "send_to_user"), assert_msg