Skip to content
Snippets Groups Projects
Commit f499636c authored by W. Spencer Smith's avatar W. Spencer Smith
Browse files

Merge branch 'patch-3' into 'master'

a few minor edits to tutorial 5, including indentation

See merge request !9
parents 86a72923 a2672c10
No related branches found
No related tags found
1 merge request!9a few minor edits to tutorial 5, including indentation
...@@ -292,7 +292,6 @@ class TestCircles: ...@@ -292,7 +292,6 @@ class TestCircles:
\end{itemize} \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. } \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} \end{itemize}
\begin{lstlisting}[language=Python, escapechar=!] \begin{lstlisting}[language=Python, escapechar=!]
>>> 1.0001 == approx(1) >>> 1.0001 == approx(1)
...@@ -304,7 +303,6 @@ True ...@@ -304,7 +303,6 @@ True
\end{lstlisting} \end{lstlisting}
\end{frame} \end{frame}
\begin{frame}[fragile] \begin{frame}[fragile]
\frametitle{Redundant code in tests} \frametitle{Redundant code in tests}
\begin{lstlisting}[language=Python, escapechar=!] \begin{lstlisting}[language=Python, escapechar=!]
...@@ -319,7 +317,7 @@ class TestCircles: ...@@ -319,7 +317,7 @@ class TestCircles:
def test_xcoord_are_not_equal(self): def test_xcoord_are_not_equal(self):
!\colorbox{yellow}{circle = CircleT(1,2,3)}! !\colorbox{yellow}{circle = CircleT(1,2,3)}!
assert circle.xcoord() != 1 assert not circle.xcoord() == 1
\end{lstlisting} \end{lstlisting}
\end{frame} \end{frame}
...@@ -341,7 +339,7 @@ class TestCircles: ...@@ -341,7 +339,7 @@ class TestCircles:
assert self.circle.xcoord() == 1 assert self.circle.xcoord() == 1
def test_xcoord_are_not_equal(self): def test_xcoord_are_not_equal(self):
assert self.circle.xcoord() != 2 assert not self.circle.xcoord() == 2
\end{lstlisting} \end{lstlisting}
\end{frame} \end{frame}
...@@ -380,8 +378,8 @@ class TestCircles: ...@@ -380,8 +378,8 @@ class TestCircles:
import pytest import pytest
def test_zero_division(): def test_zero_division():
with pytest.raises(ZeroDivisionError): with pytest.raises(ZeroDivisionError):
1 / 0 1 / 0
\end{lstlisting} \end{lstlisting}
\end{frame} \end{frame}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment