Chaos Python

Add this into your functional tests and smoke it.
import sys, random
def chaos_trace(frame, event, arg): 
    if event == 'line' and random.random() < 0.000001: 
        raise MemoryError()
    return chaos_trace
sys.settrace(chaos_trace)
You will get some lovely random failures injected into your code. A great way to find bugs, and make sure your reasoning is sound in the face of CHAOS!

Comments

tito said…
Insane. :)
kcunning said…
I adore this. Going to see how this works with games in Python for sure!

Popular posts from this blog

Draft 3 of, ^Let's write a unit test!^

Is PostgreSQL good enough?

post modern C tooling - draft 6