diff --git a/Tutorials/T05-PyUnit/notes.txt b/Tutorials/T05-PyUnit/notes.txt new file mode 100644 index 0000000000000000000000000000000000000000..3809dd0eb8f2b534b979a7fdeeee31711d9b967f --- /dev/null +++ b/Tutorials/T05-PyUnit/notes.txt @@ -0,0 +1,6 @@ +- coverage matrix +- statement matrix +- try to convert to beamer class +- keep the assignment as it is +- install pytest and coverage, if doesn¡¯t work, post questions on Avenue +- \ No newline at end of file diff --git a/Tutorials/T05-PyUnit/slides/Unit Testing.pdf b/Tutorials/T05-PyUnit/slides/Unit Testing.pdf index b902e3078ebe14b03a451005816d1be828dcad49..79591b685d7a339269b0c6f3bba69e64f2f74527 100644 Binary files a/Tutorials/T05-PyUnit/slides/Unit Testing.pdf and b/Tutorials/T05-PyUnit/slides/Unit Testing.pdf differ diff --git a/Tutorials/T05-PyUnit/slides/Unit Testing.tex b/Tutorials/T05-PyUnit/slides/Unit Testing.tex index cf6aca59892d97da175076aee30be4728f9710e0..bd12a1e7abc2cbd5a7f5266fee42cfa7a3471393 100644 --- a/Tutorials/T05-PyUnit/slides/Unit Testing.tex +++ b/Tutorials/T05-PyUnit/slides/Unit Testing.tex @@ -306,8 +306,8 @@ class TestCircles: \end{frame} \begin{frame}[fragile] -\frametitle{Redundant code in tests} -\begin{lstlisting}[language=Python] +\frametitle{Cleaned up code} +\begin{lstlisting}[language=Python, escapechar=!] import pytest from CircleADT import * @@ -327,6 +327,29 @@ class TestCircles: \end{lstlisting} \end{frame} + +\begin{frame}[fragile] +\frametitle{Setup and Teardown} +\begin{itemize} + \item{\texttt{setup\_class(cls)}} + \begin{itemize} + \item{setup any state specific to the execution of the given class} + \end{itemize} + \item{\texttt{teardown\_class(cls)}} + \begin{itemize} + \item{teardown any state that was previously setup with a call to \texttt{setup\_class}.} + \end{itemize} + \item{\texttt{setup\_method(self, method)}} + \begin{itemize} + \item{setup any state tied to the execution of the given method in a class. \texttt{setup\_method} is invoked for every test method of a class.} + \end{itemize} + \item{\texttt{teardown\_method(self, method)}} + \begin{itemize} + \item{teardown any state that was previously setup with a \texttt{setup\_method} call.} + \end{itemize} +\end{itemize} +\end{frame} + \begin{frame}[fragile] \frametitle{How much should I test?} \begin{itemize} diff --git a/Tutorials/T05-PyUnit/src/.cache/v/cache/lastfailed b/Tutorials/T05-PyUnit/src/.cache/v/cache/lastfailed new file mode 100644 index 0000000000000000000000000000000000000000..81e16c74f545f9d2c95276d0f66112d72d6044f9 --- /dev/null +++ b/Tutorials/T05-PyUnit/src/.cache/v/cache/lastfailed @@ -0,0 +1,10 @@ +{ + "test.py::test_inc": true, + "test_3.py::TestCircles::()::test_xcoord_are_not_equal": true, + "test_circles.py::CirclesTests": true, + "test_circles2.py::TestClass::()::test_xcoord_are_equal": true, + "test_circles2.py::TestClass::()::test_xcoord_are_not_equal": true, + "test_statistics.py::StatisticsTests::testAverageOfCircles": true, + "test_statistics.py::StatisticsTests::test_rank": true, + "test_statistics.py::StatisticsTests::test_stdDev": true +} \ No newline at end of file