hotfix: skip fetch tests always

This commit is contained in:
George Hotz
2024-05-01 08:43:26 -07:00
parent b683d0f496
commit bd49d2854a

View File

@@ -1,6 +1,6 @@
import unittest
from PIL import Image
from tinygrad.helpers import Context, ContextVar, merge_dicts, strip_parens, prod, round_up, fetch, fully_flatten, from_mv, to_mv, get_contraction, CI
from tinygrad.helpers import Context, ContextVar, merge_dicts, strip_parens, prod, round_up, fetch, fully_flatten, from_mv, to_mv, get_contraction
from tinygrad.shape.symbolic import Variable, NumNode
VARIABLE = ContextVar("VARIABLE", 0)
@@ -141,15 +141,14 @@ class TestRoundUp(unittest.TestCase):
self.assertEqual(round_up(232, 24984), 24984)
self.assertEqual(round_up(24984, 232), 25056)
@unittest.skip("no fetch tests because they need internet")
class TestFetch(unittest.TestCase):
def test_fetch_bad_http(self):
self.assertRaises(Exception, fetch, 'http://www.google.com/404', allow_caching=False)
@unittest.skipIf(not CI, "pre commit tests should run offline")
def test_fetch_small(self):
assert(len(fetch('https://google.com', allow_caching=False).read_bytes())>0)
@unittest.skip("test is flaky")
def test_fetch_img(self):
img = fetch("https://media.istockphoto.com/photos/hen-picture-id831791190", allow_caching=False)
with Image.open(img) as pimg: