Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
se2aa4_cs2me3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
W. Spencer Smith
se2aa4_cs2me3
Commits
eef48987
Commit
eef48987
authored
7 years ago
by
alicj
Browse files
Options
Downloads
Patches
Plain Diff
add exercise for testing
parent
849b5766
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tutorials/T05-PyUnit/slides/Unit Testing.pdf
+0
-0
0 additions, 0 deletions
Tutorials/T05-PyUnit/slides/Unit Testing.pdf
Tutorials/T05-PyUnit/slides/Unit Testing.tex
+21
-5
21 additions, 5 deletions
Tutorials/T05-PyUnit/slides/Unit Testing.tex
with
21 additions
and
5 deletions
Tutorials/T05-PyUnit/slides/Unit Testing.pdf
+
0
−
0
View file @
eef48987
No preview for this file type
This diff is collapsed.
Click to expand it.
Tutorials/T05-PyUnit/slides/Unit Testing.tex
+
21
−
5
View file @
eef48987
...
...
@@ -405,16 +405,32 @@ class TestCircles:
\begin{itemize}
\item
{
\url
{
https://pypi.python.org/pypi/pytest-cov
}}
\item
{
You can install it via pip:
\texttt
{
pip install pytest-cov
}}
\item
{
Then, in the source code directory, run
\texttt
{
pytest --cov
}}
\end{itemize}
\begin{figure}
[b]
{
\includegraphics
[width=8cm]
{
test-coverage
}}
\end{figure}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Running the coverage plugin
}
\begin{itemize}
\item
{
In the source code directory, run
\texttt
{
pytest --cov
}}
\end{itemize}
\begin{figure}
[b]
{
\includegraphics
[width=6cm]
{
test-coverage
}}
\end{figure}
\begin{itemize}
\item
{
We can see that
\texttt
{
CircleADT.py
}
has onlyl 51
\%
coverage. This is because only the methods
\texttt
{
xcoord
}
and
\texttt
{
ycoord
}
were tested
}
\end{itemize}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Exercise
}
\begin{itemize}
\item
{
The rest of the methods are left for you as practices
}
\item
{
You can Refer to testStatistics.py for a more complete breakdown on how to test complicated functions
}
\end{itemize}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Documentation on pyt
es
t
}
\frametitle
{
Referenc
es
}
\begin{itemize}
\item
{
\url
{
https://docs.pytest.org/en/latest/xunit
_
setup.html
}}
\item
{
\url
{
https://en.wikipedia.org/wiki/Code
_
coverage
}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment