"""Tests for the built-in exceptions.

Docs: https://docs.python.org/3.6/library/exceptions.html
"""

import textwrap

from ..base import Question


class CauseAssertionError(Question):
    """Cause an AssertionError.

    https://docs.python.org/3.6/library/exceptions.html#AssertionError
    """

    def get_question_text(self):
        return (
            'Cause an AssertionError.\n\n'
            'Write some code that will raise an AssertionError.\n\n'
            'Your code may not contain the words `raise` or `exec`.'
        )

    def check_answer(self, answer):
        for illegal_word in ['raise', 'exec']:
            if illegal_word in answer:
                return False
        try:
            exec(answer, {}, {})
        except AssertionError:
            return True
        except:
            return False

    def get_an_answer(self):
        return 'assert(False)'

@@ -99,25 +99,8 @@
 %22%22%0A%0A
-import textwrap%0A%0A
 from

Remove unused import