[TIP] Using coverage.py with code that uses sys.settrace()
oliver.leahy at hp.com
Wed Dec 28 07:58:07 PST 2011
What's the recommended way to use coverage.py with code that uses sys.settrace()
I'm using settrace() to simulate error conditions at certain lines during testing, but
this interferes with the use coverage.py makes of settrace() and I'm getting incorrect
I'm hacking at my code to try to store an existing value for sys.gettrace() whenever
I call settrace(), and then restoring the pre-existing trace function whenever I stop
tracing using my function, but it's not working for me at the moment.
Is this a sensible approach to this problem? Would anyone have any other suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python