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

from latex import build_pdf
from latex.exc import LatexBuildError

import pytest


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

    pdf = build_pdf(min_latex)

    assert pdf


def test_raises_correct_exception_on_fail():
    broken_latex = r"""foo"""

    with pytest.raises(LatexBuildError):
        build_pdf(broken_latex)

Test whether or not the right exception is thrown.
Test whether or not the right exception is thrown.

  from latex import build_pdf
+ from latex.exc import LatexBuildError
+ 
+ import pytest
  
  
  def test_generates_something():
      min_latex = r"""
  \documentclass{article}
  \begin{document}
  Hello, world!
  \end{document}
  """
  
      pdf = build_pdf(min_latex)
  
      assert pdf
  
+ 
+ def test_raises_correct_exception_on_fail():
+     broken_latex = r"""foo"""
+ 
+     with pytest.raises(LatexBuildError):
+         build_pdf(broken_latex)
+ 
Test whether or not the right exception is thrown.
## Code Before:
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

## Instruction:
Test whether or not the right exception is thrown.
## Code After:
from latex import build_pdf
from latex.exc import LatexBuildError

import pytest


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

    pdf = build_pdf(min_latex)

    assert pdf


def test_raises_correct_exception_on_fail():
    broken_latex = r"""foo"""

    with pytest.raises(LatexBuildError):
        build_pdf(broken_latex)
