def test_message_type(): fake1 = Fake({}, spec=chatcommunicate.Message) assert chatcommands.message(fake1) == fake1 fake2 = Fake({}) threw_exception = False try: chatcommands.message(fake2) except AssertionError: threw_exception = True assert threw_exception