Skip to content

skip tests that use assert_run_python_script on windows #7351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import random
import re
import sys
import textwrap
import warnings
from functools import partial
Expand Down Expand Up @@ -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")
Expand Down
9 changes: 9 additions & 0 deletions test/test_transforms_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pathlib
import random
import re
import sys
import textwrap
import warnings
from collections import defaultdict
Expand Down Expand Up @@ -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"""
Expand All @@ -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
Expand Down