From 78e5b663257dae6fb0bc1f81de562da17cde0fb4 Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Fri, 16 Aug 2024 23:55:48 +0100 Subject: [PATCH] Prevent spurious warnings from causing test failure. The `test_annotate_file` command may fail because the `annotate` command may emit some unexpected warnings on STDERR about invalid CURIEs, even if there are no errors and the expected output is normally produced on STDOUT. This commit amends the test so that it ignores any 'WARNING:' line in the STDERR stream produced by the `annotate` command. closes #795. --- tests/test_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 3fc048585..00f33bb1c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1522,7 +1522,7 @@ def test_annotate_file(self): ], ) print("STDERR", result.stdout) - err = result.stderr + err = "\n".join([line for line in result.stderr.split("\n") if not line.startswith("WARNING")]) self.assertEqual("", err) self.assertEqual(0, result.exit_code) with open(outfile) as stream: