From 00dacb595361e2ac57ac7c2113dadcaa3f3ea3f9 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Sun, 7 Mar 2021 18:21:48 -0800 Subject: [PATCH] Fix broken PyTorch Lightning test Closes #547 Ref #551 Signed-off-by: Ben Firshman --- python/tests/test_pl_callback.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/tests/test_pl_callback.py b/python/tests/test_pl_callback.py index 6c529205..0099b62c 100644 --- a/python/tests/test_pl_callback.py +++ b/python/tests/test_pl_callback.py @@ -12,6 +12,7 @@ from torchvision.datasets import MNIST from torchvision import transforms import pytest +import urllib from keepsake.pl_callback import KeepsakeCallback @@ -35,6 +36,12 @@ def forward(self, x): return x def prepare_data(self): + # HACK: https://github.com/pytorch/vision/issues/1938 + # But, we shouldn't have to do this: https://github.com/replicate/keepsake/issues/551 + opener = urllib.request.build_opener() + opener.addheaders = [("User-agent", "Mozilla/5.0")] + urllib.request.install_opener(opener) + # download only MNIST( "/tmp/keepsake-test-mnist",