From fe68c5869866149b1c00d6280f3e491883d0b7e9 Mon Sep 17 00:00:00 2001 From: Gleb Nikonorov Date: Sat, 20 Jun 2020 13:06:41 -0400 Subject: [PATCH] add test_warn_missing case for --assert=plain --- testing/test_assertion.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index f28a51f96..64a94941a 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1400,6 +1400,13 @@ def test_warn_missing(testdir): result = testdir.run(sys.executable, "-OO", "-m", "pytest") result.stdout.fnmatch_lines(warning_output) + warning_output = [ + "=*= warnings summary =*=", + "*PytestConfigWarning: ASSERTIONS ARE NOT EXECUTED and FAILING TESTS WILL PASS. Are you using python -O?", + ] + result = testdir.run(sys.executable, "-OO", "-m", "pytest", "--assert=plain") + result.stdout.fnmatch_lines(warning_output) + def test_recursion_source_decode(testdir): testdir.makepyfile(