Skip to content

Commit

Permalink
[fbsync] skip tests that use assert_run_python_script on windows (#7351)
Browse files Browse the repository at this point in the history
Reviewed By: vmoens

Differential Revision: D44416640

fbshipit-source-id: 0ebceef6717d0900f019631d5506900928d553af
  • Loading branch information
NicolasHug authored and facebook-github-bot committed Mar 30, 2023
1 parent 02d0a7c commit 432e831
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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

0 comments on commit 432e831

Please sign in to comment.