From f840521854d15288b57315c56b620001dd534d12 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 7 Nov 2018 19:29:55 +0100 Subject: [PATCH] harden test_collect_init_tests --- testing/test_collection.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/testing/test_collection.py b/testing/test_collection.py index c7cde090e..18033b9c0 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -975,31 +975,34 @@ def test_collect_init_tests(testdir): result.stdout.fnmatch_lines( [ "collected 2 items", - "", " ", " ", - "", - " ", + " ", + " ", ] ) - # XXX: Same as before, but different order. + # Same as before, but different order. result = testdir.runpytest(".", "tests", "--collect-only") result.stdout.fnmatch_lines( [ "collected 2 items", - "", " ", " ", - "", " ", ] ) result = testdir.runpytest("./tests/test_foo.py", "--collect-only") - result.stdout.fnmatch_lines(["*", "*"]) + result.stdout.fnmatch_lines( + ["", " ", " "] + ) assert "test_init" not in result.stdout.str() result = testdir.runpytest("./tests/__init__.py", "--collect-only") - result.stdout.fnmatch_lines(["*", "*"]) + result.stdout.fnmatch_lines( + ["", " ", " "] + ) assert "test_foo" not in result.stdout.str()