DOC: Add more slides on testing scipy2010
authorChristopher Burns <chris.d.burns@gmail.com>
Tue, 29 Jun 2010 00:59:26 -0500
branchscipy2010
changeset 432 13e5d0e2cd40
parent 431 9126059d6b37
child 433 af45c8da1d5d
DOC: Add more slides on testing
day2/session4.tex
--- a/day2/session4.tex	Tue Jun 29 00:30:21 2010 -0500
+++ b/day2/session4.tex	Tue Jun 29 00:59:26 2010 -0500
@@ -202,6 +202,23 @@
   \end{itemize}
 \end{frame}
 
+
+\begin{frame}[fragile]
+  \frametitle{Automating tests}
+  \begin{lstlisting}
+  
+def gcd(a, b):
+    if a % b == 0:
+        return b
+    return gcd(b, a % b)
+
+if __name__ == '__main__':
+    assert gcd(15, 65) == 5
+    assert gcd(16, 76) == 4
+
+  \end{lstlisting}  
+\end{frame}
+
 \begin{frame}[fragile]
   \frametitle{Automating tests}
   \begin{lstlisting}
@@ -217,6 +234,18 @@
   \end{lstlisting}  
 \end{frame}
 
+\begin{frame}[fragile]
+  \frametitle{Python Test Packages}
+    \begin{itemize}
+
+\item Python's \typ{unittest}:\linebreak
+  \url{http://docs.python.org/library/unittest.html}
+\linebreak
+\item \typ{nose}:\linebreak
+  \url{http://code.google.com/p/python-nose/}
+  \end{itemize}
+\end{frame}
+
 \section{Coding Style}
 \begin{frame}{Readability and Consistency}
     \begin{itemize}