From 6394867952c000d065327ddcaff5da5db7e7ce79 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Thu, 3 Nov 2022 09:58:08 +0100 Subject: [PATCH] behave: Remove InsecureRequestWarning that is irrelevant to the tests from stderr --- behave/features/steps/osc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/behave/features/steps/osc.py b/behave/features/steps/osc.py index 95972b99..71295cc4 100644 --- a/behave/features/steps/osc.py +++ b/behave/features/steps/osc.py @@ -1,4 +1,5 @@ import os +import re import shutil import tempfile import time @@ -54,6 +55,8 @@ def step_impl(context, args): cmd = context.osc.get_cmd() + [args] cmd = " ".join(cmd) run_in_context(context, cmd, can_fail=True) + # remove InsecureRequestWarning that is irrelevant to the tests + context.cmd_stderr = re.sub(r"^.*InsecureRequestWarning.*\n warnings.warn\(\n", "", context.cmd_stderr) @behave.step('I wait for osc results for "{project}" "{package}"')