From d027f760c0aad45d038617971846c20f71b9b590 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 20 Mar 2017 20:40:53 -0300 Subject: [PATCH] Avoid displaying the same warning multiple times for an item --- _pytest/warnings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pytest/warnings.py b/_pytest/warnings.py index 7d29460b3..bfa2b0087 100644 --- a/_pytest/warnings.py +++ b/_pytest/warnings.py @@ -51,7 +51,7 @@ def catch_warnings_for_item(item): args = item.config.getoption('pythonwarnings') or [] inifilters = item.config.getini("filterwarnings") with warnings.catch_warnings(record=True) as log: - warnings.simplefilter('always') + warnings.simplefilter('once') for arg in args: warnings._setoption(arg)