Click here to code!

Code Challenge 39 - Writing Tests With Pytest - Review

Posted by PyBites on Wed 01 November 2017 in Challenges • 1 min read

In this article we review last week's Writing Tests With Pytest code challenge.

Submissions

Julian and myself both wrote some tests with pytest for this challenge:

  • hobojoe1848: This is the simplest of the simple. It's a single PyTest function to test whether the output of a very simple text conversion script works. My first PyTest script ever! Code is here.

  • bbelderbos: First time use of pytest for DB tests, used a fixture, was good learning. Code is here.

pytest is a great tool and writing good tests is a fundamental skill. Also writing code that needs to be tested changes your design for the better.

Given the amount on activity on PyBites we only touched the surface though. Luckily Brian Okken's great book saved and will save us a lot of time learning the ins and outs of pytest. Julian will also do a quick beginner guide ...


Keep Calm and Code in Python!

-- Bob and Julian


See an error in this post? Please submit a pull request on Github.


Join our community and grab our Become a Better Python Developer cheat sheet. Learn Python. Receive bonus material. Challenge yourself!