Fix flaky test_timing_function in Windows

This tests fails consistently on Windows due to small time
difference:

>       assert float(val) >= 0.03
E       assert 0.0299999713898 >= 0.03
E        +  where 0.0299999713898 = float('0.0299999713898')

Windows time.time() function is not as accurate as linux's,
so relaxed the test a bit.
This commit is contained in:
Bruno Oliveira 2015-07-04 14:49:04 -03:00
parent d773c7498f
commit 438ea86137
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class TestPython:
node = dom.getElementsByTagName("testsuite")[0] node = dom.getElementsByTagName("testsuite")[0]
tnode = node.getElementsByTagName("testcase")[0] tnode = node.getElementsByTagName("testcase")[0]
val = tnode.getAttributeNode("time").value val = tnode.getAttributeNode("time").value
assert float(val) >= 0.03 assert round(float(val), 2) >= 0.03
def test_setup_error(self, testdir): def test_setup_error(self, testdir):
testdir.makepyfile(""" testdir.makepyfile("""