earn the White PyBites Ninja earn the Yellow PyBites Ninja earn the Orange PyBites Ninja right arrow earn more PyBites Ninja belts and certificates
The best way to learn to code in Python is to actually use the language.

Our platform offers effective Test Driven Learning which will be key to your progress.

Join thousands of Pythonistas and start coding!

Join us on our PyBites Platform
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.


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.