From c14d485e4e74d20c36f19750157e789e68e91474 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 13 Jan 2022 17:06:01 +0100 Subject: [PATCH] Ignore spurious ResourceWarning in tests This fixes the test when using the --open-browser option on Linux --- conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conftest.py b/conftest.py index 16897f5..7c2594b 100644 --- a/conftest.py +++ b/conftest.py @@ -1,6 +1,7 @@ """Setup for Pytest.""" # Standard library imports +import warnings import webbrowser # Third party imports @@ -31,5 +32,8 @@ def open_browser(request): """Show the passed URL in the user's web browser if passed.""" def _open_browser(url): if request.config.getoption(OPEN_BROWSER_OPTION): + warnings.filterwarnings( + 'ignore', category=ResourceWarning, module='subprocess.*') + webbrowser.open_new_tab(url) return _open_browser