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!

Enough pytest to be Dangerous, 10 Things I Learned Writing Tests for 100 Python (Bites of Py) Exercises

Posted by Bob on Thu 07 June 2018 in Testing • Tagged with pytest, learning, mock, parametrize, capfd, fixtures • 8 min read

We hit 100 Bite exercises on our Code Platform and that means we have written tests for 100 exercises. In this article I share 10 things I learned about writing test code and pytest.


Continue reading

Parsing Twitter Geo Data and Mocking API Calls by Example

Posted by Bob on Sat 17 June 2017 in Testing • Tagged with twitter, API, mock, geo, data, unittest, pickle, tweepy, testing, 100days • 2 min read

"Is this Bob or Julian?!" ... yeah tweeting from our shared @pybites Twitter account can be confusing! So I made a little script to parse the location of our tweets. Then I extended it to make it testable. I wrote a decorator to cache a couple of API outputs to be used with the unittest.mock patch decorator I learned about. A simple script turned into a good learning exercise.


Continue reading