From 438ea86137b3dde860d940d5eb3997bbbd28ba1f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 4 Jul 2015 14:49:04 -0300 Subject: [PATCH] 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. --- testing/test_junitxml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 6258cb473..f8acd1576 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -55,7 +55,7 @@ class TestPython: node = dom.getElementsByTagName("testsuite")[0] tnode = node.getElementsByTagName("testcase")[0] val = tnode.getAttributeNode("time").value - assert float(val) >= 0.03 + assert round(float(val), 2) >= 0.03 def test_setup_error(self, testdir): testdir.makepyfile("""