Thursday, 15 July 2010

Getting test results from nosetests in Python module -



Getting test results from nosetests in Python module -

i'm running module runs nosetests timer this:

import nose nosetimer import plugin collections import defaultdict import time import pandas pd plugin = plugin.timerplugin() plugin.enabled = true plugin.timer_ok = 1000 plugin.timer_warning = 2000 plugin.timer_no_color = false loglist = defaultdict(list) nose.run(plugins=[plugin]) result = plugin._timed_tests test in result: loglist[test].append(result[test])

and wondering if it's possible mapping of each test name pass/fail/error this:

{ 'example.file.path.test1': 'pass', 'example.file.path.test2': 'pass', 'example.file.test3': 'fail', 'example.file.test4': 'pass', 'example.file.path2.test5': 'error', 'example.file.path2.test6': 'pass' }

but without reading stdout. in other words, there location nose stores information? i've been reading documentation , code hours no luck, sense may missing something.

this info available, @ to the lowest degree far can recall off top of head, way @ using nose plugin interface write own plugin. plugins aren't complicated though, this. you'd need pass, fail/error, , start test hooks, along test.address(), working, if memory serves.

python python-2.7 nose

No comments:

Post a Comment