From 486ded3fcae5aac100b49e49ef55192053e15807 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 14 Oct 2018 12:22:56 -0300 Subject: [PATCH 1/2] Fix flaky durations test Unfortunately due to fluctuations in runtime "test_something" might still appear in the final message. Example failure: https://ci.appveyor.com/project/pytestbot/pytest/builds/19494829/job/8lx847u0c78m63wf --- testing/acceptance_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 6f791dc84..41cdba067 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -808,7 +808,6 @@ class TestDurations(object): result.stdout.fnmatch_lines_random( ["*durations*", "*call*test_3*", "*call*test_2*"] ) - assert "test_something" not in result.stdout.str() result.stdout.fnmatch_lines( ["(0.00 durations hidden. Use -vv to show these durations.)"] ) From 48081458466f1ae62766be7593cc9b9e682ddbef Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 14 Oct 2018 15:17:08 -0300 Subject: [PATCH 2/2] test_request_garbage is flaky when running with xdist Example failure: https://travis-ci.org/pytest-dev/pytest/jobs/441305926#L545 --- testing/python/fixture.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testing/python/fixture.py b/testing/python/fixture.py index 7e125e0b7..7ec7e9c1c 100644 --- a/testing/python/fixture.py +++ b/testing/python/fixture.py @@ -494,6 +494,12 @@ class TestRequestBasic(object): reason="this method of test doesn't work on pypy", ) def test_request_garbage(self, testdir): + try: + import xdist # noqa + except ImportError: + pass + else: + pytest.xfail("this test is flaky when executed with xdist") testdir.makepyfile( """ import sys