Skip to content

Commit ffd7bd5

Browse files
committed
Avoid error on warnings for 3.12 in transforms tests
1 parent 848443b commit ffd7bd5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/test_transforms_v2.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@
5454

5555

5656
# turns all warnings into errors for this module
57-
pytestmark = pytest.mark.filterwarnings("error")
57+
pytestmark = [pytest.mark.filterwarnings("error")]
58+
59+
if sys.version_info[:2] >= (3, 12):
60+
# torchscript relies on some AST stuff that got deprecated in 3.12,
61+
# so we have to explicitly ignore those otherwise we'd error on warnings due to the pytestmark filter above.
62+
pytestmark.append(pytest.mark.filterwarnings("ignore::DeprecationWarning"))
5863

5964

6065
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)