import subprocess, re


def keyerror(error_message):
    return re.search(r"KeyError: (.*)", error_message).group(1)


output = subprocess.run(["python3", "quine.py"], capture_output=True, text=True).stderr

with open("quine.py", "r") as f:
    content = f.read()

assert keyerror(output) == repr(content)
print("Success!")
