from latex import build_pdf


def test_generates_something():
    min_latex = r"""
\documentclass{article}
\begin{document}
Hello, world!
\end{document}
"""

    pdf = build_pdf(min_latex)

    assert pdf

@@ -21,16 +21,69 @@
 ild_pdf%0A
+from latex.exc import LatexBuildError%0A%0Aimport pytest%0A
 %0A%0Adef te
@@ -247,12 +247,163 @@
  assert pdf%0A
+%0A%0Adef test_raises_correct_exception_on_fail():%0A    broken_latex = r%22%22%22foo%22%22%22%0A%0A    with pytest.raises(LatexBuildError):%0A        build_pdf(broken_latex)%0A

Test whether or not the right exception is thrown.