From 662ae7864cede005296723eb57f039261a5ee711 Mon Sep 17 00:00:00 2001 From: Sanchit Rishi Date: Sat, 20 Dec 2025 19:44:53 +0530 Subject: [PATCH 1/3] Added CREATE_NO_WINDOW flag on Windows to prevent console window overhead --- lib/matplotlib/testing/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/testing/__init__.py b/lib/matplotlib/testing/__init__.py index eff079efe887..7ce69c7c4d51 100644 --- a/lib/matplotlib/testing/__init__.py +++ b/lib/matplotlib/testing/__init__.py @@ -92,6 +92,15 @@ def subprocess_run_for_testing(command, env=None, timeout=60, stdout=None, """ if capture_output: stdout = stderr = subprocess.PIPE + + # Add CREATE_NO_WINDOW flag on Windows to prevent console window overhead + # This significantly reduces subprocess creation time and helps avoid timeouts + if sys.platform == 'win32': + if 'creationflags' not in kwargs: + kwargs['creationflags'] = subprocess.CREATE_NO_WINDOW + else: + kwargs['creationflags'] |= subprocess.CREATE_NO_WINDOW + try: proc = subprocess.run( command, env=env, @@ -284,4 +293,4 @@ def _gen_multi_font_text(): in between!""" # The resulting string contains 491 unique characters. Some file formats use 8-bit # tables, which the large number of characters exercises twice over. - return fonts, test_str + return fonts, test_str \ No newline at end of file From bb3f68a6c746d68256d23ff07cf7b87929fa1d2d Mon Sep 17 00:00:00 2001 From: Sanchit Rishi Date: Sat, 20 Dec 2025 19:58:48 +0530 Subject: [PATCH 2/3] Fixed Ruff Failed check error --- lib/matplotlib/testing/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/matplotlib/testing/__init__.py b/lib/matplotlib/testing/__init__.py index 7ce69c7c4d51..fbb5a6ceb080 100644 --- a/lib/matplotlib/testing/__init__.py +++ b/lib/matplotlib/testing/__init__.py @@ -92,7 +92,6 @@ def subprocess_run_for_testing(command, env=None, timeout=60, stdout=None, """ if capture_output: stdout = stderr = subprocess.PIPE - # Add CREATE_NO_WINDOW flag on Windows to prevent console window overhead # This significantly reduces subprocess creation time and helps avoid timeouts if sys.platform == 'win32': @@ -100,7 +99,6 @@ def subprocess_run_for_testing(command, env=None, timeout=60, stdout=None, kwargs['creationflags'] = subprocess.CREATE_NO_WINDOW else: kwargs['creationflags'] |= subprocess.CREATE_NO_WINDOW - try: proc = subprocess.run( command, env=env, From a46095e5f32637f147507520838aa76e5cfe212b Mon Sep 17 00:00:00 2001 From: Sanchit Rishi Date: Sat, 20 Dec 2025 20:00:41 +0530 Subject: [PATCH 3/3] Fixed Ruff error --- lib/matplotlib/testing/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/testing/__init__.py b/lib/matplotlib/testing/__init__.py index fbb5a6ceb080..2da7b815224c 100644 --- a/lib/matplotlib/testing/__init__.py +++ b/lib/matplotlib/testing/__init__.py @@ -291,4 +291,4 @@ def _gen_multi_font_text(): in between!""" # The resulting string contains 491 unique characters. Some file formats use 8-bit # tables, which the large number of characters exercises twice over. - return fonts, test_str \ No newline at end of file + return fonts, test_str