How to fix PytestUnraisableExceptionWarning: Event loop is closed in Python | DevErrors