diff --git a/test/test_transforms.py b/test/test_transforms.py index 03b385e9edd..b6eccba421b 100644 --- a/test/test_transforms.py +++ b/test/test_transforms.py @@ -2,6 +2,7 @@ import os import random import re +import sys import textwrap import warnings from functools import partial @@ -2278,6 +2279,10 @@ def test_random_grayscale_with_grayscale_input(): ), ) @pytest.mark.parametrize("from_private", (True, False)) +@pytest.mark.skipif( + sys.platform in ("win32", "cygwin"), + reason="assert_run_python_script is broken on Windows. Possible fix in https://github.com/pytorch/vision/pull/7346", +) def test_functional_deprecation_warning(import_statement, from_private): if from_private: import_statement = import_statement.replace("functional", "_functional") diff --git a/test/test_transforms_v2.py b/test/test_transforms_v2.py index f5ca976963a..9fe7bbf51f2 100644 --- a/test/test_transforms_v2.py +++ b/test/test_transforms_v2.py @@ -2,6 +2,7 @@ import pathlib import random import re +import sys import textwrap import warnings from collections import defaultdict @@ -2101,6 +2102,10 @@ def test_sanitize_bounding_boxes_errors(): ), ) @pytest.mark.parametrize("call_disable_warning", (True, False)) +@pytest.mark.skipif( + sys.platform in ("win32", "cygwin"), + reason="assert_run_python_script is broken on Windows. Possible fix in https://github.com/pytorch/vision/pull/7346", +) def test_warnings_v2_namespaces(import_statement, call_disable_warning): if call_disable_warning: source = f""" @@ -2120,6 +2125,10 @@ def test_warnings_v2_namespaces(import_statement, call_disable_warning): assert_run_python_script(textwrap.dedent(source)) +@pytest.mark.skipif( + sys.platform in ("win32", "cygwin"), + reason="assert_run_python_script is broken on Windows. Possible fix in https://github.com/pytorch/vision/pull/7346", +) def test_no_warnings_v1_namespace(): source = """ import warnings