This tutorial helps you to learn automated testing in Python using the
pytest framework.
Goal: Count Words in Moby Dick
Captain Ahab was vicious because Moby Dick, the white whale, had bitten off his leg. So the captain set sail for a hunt. For months he was searching the sea for the white whale. The captain finally attacked the whale with a harpoon. Unimpressed, the whale devoured captain, crew and ship. The whale won.
Herman Melville’s book “Moby Dick” describes the epic fight between the captain of a whaling ship and a whale. In the book, the whale wins by eating most of the other characters. But does he also win by being mentioned more often?
In this course, you will test a program that is counting words in Melvilles book.
clone the repository:
git clone https://github.com/krother/python_testing_tutorial.git
install pytest:
pip install pytest
.. toctree:: :maxdepth: 1 articles/unit_tests.rst articles/fixtures.rst articles/parameterized.rst articles/organizing_tests.rst articles/test_coverage.rst
.. toctree:: :maxdepth: 1 articles/links.rst articles/quotes.rst articles/find_pairs.rst articles/instructions_for_trainers.rst
License
this tutorial was contributed to by Kristian Rother, Magdalena Rother, Daniel Szoska
Usable under the conditions of the Creative Commons Attribution License 4.0 (CC-BY 4.0). See creativecommons.org for details
Feedback and comments are welcome at: kristian.rother@posteo.de
Sources for this tutorial: github.com/krother/python_testing_tutorial.

