Originally reported by: **BitBucket: [luked2](http://bitbucket.org/luked2), GitHub: [luked2](http://github.com/luked2)** --- I created the following test: ``` import time def test_bar(): time.sleep(2) ``` When I run the test: % py.test --junitxml=out.xml the resulting XML shows the overall time correctly, but the time for each individual test always comes up as zero: ``` <?xml version="1.0" encoding="utf-8"?><testsuite name="" errors="0" failures="0" skips="0" tests="1" time="2.013" > <testcase classname="test_foo" name="test_bar" time="0"></testcase></testsuite> ``` --- - Bitbucket: https://bitbucket.org/pytest-dev/pytest/issue/47
Activity
pytestbot commentedon May 28, 2011
Original comment by BitBucket: luked2, GitHub: luked2:
The following patch fixes the problem, but I couldn't say why.
pytestbot commentedon May 28, 2011
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):
fix issue47 - fix time-per-test timing output for junitxml
pytestbot commentedon May 28, 2011
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):
you can install the fix with "pip install -i http://pypi.testrun.org -U pytest" - thanks for your quick patch which showed me where the problem was (the memorizing/access of timings per test item was done with a wrong key).
Merge pull request pytest-dev#47 from ahlmss/fix_pyinstall_unit
Create "prof" directory if it doesn't exist. (pytest-dev#47)