From 5cfce026f87cc11f1eda540ea96ae55e8ab4fb09 Mon Sep 17 00:00:00 2001 From: "Nathaniel J. Smith" Date: Mon, 1 Jun 2020 23:50:07 -0700 Subject: [PATCH] Make test more specific to prevent flakiness Sometimes ResourceWarnings decide to print during this test, and that used to cause it to fail every once in a while. --- trio/tests/test_threads.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trio/tests/test_threads.py b/trio/tests/test_threads.py index 632ce13656..a9059fef79 100644 --- a/trio/tests/test_threads.py +++ b/trio/tests/test_threads.py @@ -270,7 +270,8 @@ async def child(): # Make sure we don't have a "Exception in thread ..." dump to the console: out, err = capfd.readouterr() - assert not out and not err + assert "Exception in thread" not in out + assert "Exception in thread" not in err @pytest.mark.parametrize("MAX", [3, 5, 10])