Skip to content

{ Category Archives } Testing

Test-driven software development

Acceptance Testing .NET Applications using IronPython

The following was originally published in the excellent Python Magazine. Thier contractual exclusivity period has now long expired, so here it comes again. Many thanks to my technical reviewer Michael Foord, and to the editors Brandon Craig Rhodes and Doug Hellmann, who patiently gave excellent and much needed guidance through its protracted gestation, and especially [...]

Use of Asserts in Unit-Tested Code

I pretty much abandoned the use of asserts in production code once I was introduced to test driven development. Amongst their failings, assert statements are only suited to testing very localised conditions, such as within a particular function – it’s not clear to me how they can be used to simply verify the behaviour of [...]

Testwatcher

Sometimes when programming I like to leave unit tests running repeatedly in one window while editing the code and tests in another. The bash command watch is useful for this, and can highlight the differences between one invocation and the next in inverse. I wanted a version of watch for use on Windows, so I [...]

Using assertAlmostEquals to compare to N Significant Figures

I want a Python unittest.assertAlmostEquals that compares numbers to N significant figures, instead of N decimal places. >>> test.assertAlmostEquals(1e-8, 5e-14) >>> Even though these two numbers differ by a factor of 5 million, when comparing them to seven decimal places (assertAlmostEquals default behaviour) they are equal. I’ve made a first stab this by overriding assertAlmostEquals [...]

Acceptance testing a pyglet application

I’ve been trying to create a simple acceptance test for a pyglet application. A thorough suite of acceptance tests, verifying the correctness of all the shapes drawn to the screen by OpenGL, sounds like far more work than I want to do. But a couple of simple acceptance tests would be valuable, to check out [...]

PyCon 2008, Chicago, USA

PyCon 2008 has been absolutely amazing this week. The talks I’ve seen and the people I’ve met have been a real inspiration, and my head is a-whirl with ideas. Above all, as always, I’m impressed by the Python community’s genuine warmth. Maybe it’s just a function of Python being relatively small compared to some other [...]

PyCon UK 2007

Had a marvellous time at PyCon UK 2007, a conference about the Python programming language. In the event everyone from Resolver bar one of our directors went along. We met loads of great and interesting folks, heard many excellent talks, and gave a few of our own: Michael talked about driving Microsoft’s natty new Silverlight [...]