From 1cc404298771806f8edb77ec75b8e72dfdea32ed Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 10 Mar 2022 20:47:12 -0800 Subject: [PATCH] tests: move 'is_mingw' helper into gvtest library --- rtest/gvtest.py | 4 ++++ rtest/test_regression.py | 10 +--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/rtest/gvtest.py b/rtest/gvtest.py index 7e6bc6292..8cfd74b22 100644 --- a/rtest/gvtest.py +++ b/rtest/gvtest.py @@ -109,6 +109,10 @@ def gvpr(program: Path) -> str: stdin=subprocess.DEVNULL, universal_newlines=True) +def is_mingw() -> bool: + """is the current platform MinGW?""" + return "mingw" in sysconfig.get_platform() + def run_c(src: Path, args: List[str] = None, input: str = "", cflags: List[str] = None, link: List[str] = None ) -> Tuple[str, str]: diff --git a/rtest/test_regression.py b/rtest/test_regression.py index 27dd231dc..c80b03e35 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -15,21 +15,13 @@ import signal import stat import subprocess import sys -import sysconfig import tempfile from typing import List import xml.etree.ElementTree as ET import pytest sys.path.append(os.path.dirname(__file__)) -from gvtest import dot, gvpr, ROOT, run_c #pylint: disable=C0413 - -def is_mingw() -> bool: - """ - are we running on MinGW? - """ - - return "mingw" in sysconfig.get_platform() +from gvtest import dot, gvpr, is_mingw, ROOT, run_c #pylint: disable=C0413 def is_ndebug_defined() -> bool: """ -- 2.40.0