diff --git a/Tutorials/T05-PyUnit/slides/Unit Testing.tex b/Tutorials/T05-PyUnit/slides/Unit Testing.tex index 86232d9bcf8d138e6b97d3afad09d2c738f1d7a2..997ca72163f5ed5963b0d47d66eae828382fd4fa 100644 --- a/Tutorials/T05-PyUnit/slides/Unit Testing.tex +++ b/Tutorials/T05-PyUnit/slides/Unit Testing.tex @@ -292,7 +292,6 @@ class TestCircles: \end{itemize} \item{By default, \texttt{approx} considers numbers within a relative tolerance of 1e-6 and absolute tolerance of 1e-12 of its expected value to be equal. } - \end{itemize} \begin{lstlisting}[language=Python, escapechar=!] >>> 1.0001 == approx(1) @@ -304,7 +303,6 @@ True \end{lstlisting} \end{frame} - \begin{frame}[fragile] \frametitle{Redundant code in tests} \begin{lstlisting}[language=Python, escapechar=!] @@ -319,7 +317,7 @@ class TestCircles: def test_xcoord_are_not_equal(self): !\colorbox{yellow}{circle = CircleT(1,2,3)}! - assert circle.xcoord() != 1 + assert not circle.xcoord() == 1 \end{lstlisting} \end{frame} @@ -341,7 +339,7 @@ class TestCircles: assert self.circle.xcoord() == 1 def test_xcoord_are_not_equal(self): - assert self.circle.xcoord() != 2 + assert not self.circle.xcoord() == 2 \end{lstlisting} \end{frame} @@ -380,8 +378,8 @@ class TestCircles: import pytest def test_zero_division(): -with pytest.raises(ZeroDivisionError): -1 / 0 + with pytest.raises(ZeroDivisionError): + 1 / 0 \end{lstlisting} \end{frame}