Skip to content

Commit 1718a82

Browse files
committed
Revert "only fail on warnings from the pytorch ecosystem"
This reverts commit 2bf3aa6.
1 parent 2bf3aa6 commit 1718a82

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

test/builtin_dataset_mocks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pathlib
1111
import pickle
1212
import random
13+
import warnings
1314
import xml.etree.ElementTree as ET
1415
from collections import defaultdict, Counter
1516

@@ -470,7 +471,10 @@ def imagenet(info, root, config):
470471
]
471472
num_children = 1
472473
synsets.extend((0, "", "", "", num_children, [], 0, 0) for _ in range(5))
473-
savemat(data_root / "meta.mat", dict(synsets=synsets))
474+
with warnings.catch_warnings():
475+
# The warning is not for savemat, but rather for some internals savemet is using
476+
warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning)
477+
savemat(data_root / "meta.mat", dict(synsets=synsets))
474478

475479
make_tar(root, devkit_root.with_suffix(".tar.gz").name, compression="gz")
476480
else: # config.split == "test"

test/test_prototype_builtin_datasets.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ def test_coverage():
3535
)
3636

3737

38-
# This fails a test in case any warning is raised in torch, torchvision, or torchdata
39-
@pytest.mark.filterwarnings("error:::torch(vision|data)?.*")
38+
@pytest.mark.filterwarnings("error")
4039
class TestCommon:
4140
@parametrize_dataset_mocks(DATASET_MOCKS)
4241
def test_smoke(self, test_home, dataset_mock, config):

0 commit comments

Comments
 (0)