From fd0b3e2e8bab00693d3b5bcea47e5aa94eb42f7c Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 14 Apr 2019 23:15:31 +0200 Subject: [PATCH] getreportopt: remove needless if --- src/_pytest/terminal.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 2d7132259..c2d0d0ce1 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -165,15 +165,14 @@ def getreportopt(config): reportchars += "w" elif config.option.disable_warnings and "w" in reportchars: reportchars = reportchars.replace("w", "") - if reportchars: - for char in reportchars: - if char == "a": - reportopts = "sxXwEf" - elif char == "A": - reportopts = "sxXwEfpP" - break - elif char not in reportopts: - reportopts += char + for char in reportchars: + if char == "a": + reportopts = "sxXwEf" + elif char == "A": + reportopts = "sxXwEfpP" + break + elif char not in reportopts: + reportopts += char return reportopts