Random notes from mg

a blog by Marius Gedminas

Marius is a Python hacker. He works for Programmers of Vilnius, a small Python/Zope 3 startup. He has a personal home page at http://gedmin.as. His email is marius@gedmin.as. He does not like spam, but is not afraid of it.

Sat, 14 Jul 2007

Post-EuroPython 2007 sprint day 3

Previous entry.

The numbers I posted earlier about zope.testing self-test coverage were incorrect. It turns out that when a test runner tries to trace a test that tests that a (different) test runner can use tracing to trace (different) tests, they both compete over a single sys.settrace() hook and only one of them wins. Basically you get to choose between a failing test or incomplete test coverage that ignores all subsequent tests.

If I skip the three tests that invoke sys.settrace() and run the rest with --coverage, I get that the zope.testing test suite covers 73% of the code. That's not bad, considering that some of the code is only invoked in a subprocess (which we cannot trace), and some of the code is platform-specific (if sys.platform == 'win32'), and some is Python-version-specific.

If I monkey-patch sys.settrace to set the hook only the first time it's called, I get one failing test (as expected) and I see 77% test coverage.

Oh, I forgot: that's the coverage with my prototype colorizing code which doesn't have unit tests yet. On trunk the coverage reaches 81%.

By the way, yesterday was the first time I saw an OLPC laptop in real life. It's so small and cute.

Vika and OLPC
Vika holding the XO laptop. What does XO mean, anyway?

Technorati tag:

posted at 17:55 | python permanent link to this entry | 0 comments

Name (required)

E-mail (will not be shown)


Comment (some HTML allowed)