Python Testing and Structure
Dec 13, 2015
I’ve been working a little more on my [Raspberry Pi Temperature Monitor][pi-temp-monitor] and wanted to check out how to do some [Test-driven Development][TDD]. So, I started by looking into how I might write some tests and structure my code so I looked at the [Python unittest documents][py-unittest] and [class documents][py-classes]. I also ran into [this guide][py-guide] which was quite informative. I think it turned out alright (though I’m sure things may have evolved since 2009, when the guide was written. Like anything else, the code can be refactored and improved incrementally. [TDD]: https://en.wikipedia.org/wiki/Test-driven_development [py-guide]: http://infinitemonkeycorps.net/docs/pph/ [py-unittest]: https://docs.python.org/3/library/unittest.html [py-classes]: https://docs.python.org/3/tutorial/classes.html [pi-temp-monitor]: https://github.com/justinharringa/pi-temp-monitor
comments powered by Disqus