From 9c13d7e9a7e2ba1f64e3eb6610ed4d7fb8cca30f Mon Sep 17 00:00:00 2001 From: Peter Corke Date: Mon, 3 Aug 2026 17:51:50 +1000 Subject: [PATCH] test: fetch iread() URL-handling test image from GitHub, not petercorke.com test_iread and test_iread_url_handling both hit https://petercorke.com/files/images/monalisa.png over real HTTPS to exercise iread()'s URL-fetch path. PR #37 (6ff62b17) fixed the repeated flaky failures these caused by adding a socket timeout, but that only makes a slow/unavailable personal server fail fast instead of hanging -- it doesn't remove the dependency on that server's uptime. Switched both to raw.githubusercontent.com, serving the identical image already tracked in this repo (packages/mvtb-data/mvtbdata/images/monalisa.png -- confirmed same (700, 677, 3) shape as the file the old URL served). GitHub's raw content is served via a CDN, considerably more robust under CI load than a single personal server, and since the file already lives in this repo there's no new dependency to maintain. Co-Authored-By: Claude Sonnet 5 --- tests/base/test_io.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/base/test_io.py b/tests/base/test_io.py index 441fefa4..d60dad0c 100644 --- a/tests/base/test_io.py +++ b/tests/base/test_io.py @@ -53,7 +53,7 @@ def test_iread(self): # URL image try: - im = iread("https://petercorke.com/files/images/monalisa.png") + im = iread("https://raw.githubusercontent.com/petercorke/machinevision-toolbox-python/main/packages/mvtb-data/mvtbdata/images/monalisa.png") except (ValueError, urllib.error.URLError) as e: raise unittest.SkipTest(f"Network unavailable: {e}") from e self.assertIsInstance(im[0], np.ndarray) @@ -608,7 +608,7 @@ def test_iread_url_handling(self): """Test iread with URL""" # This tests the URL loading path try: - im, filename = iread("https://petercorke.com/files/images/monalisa.png") + im, filename = iread("https://raw.githubusercontent.com/petercorke/machinevision-toolbox-python/main/packages/mvtb-data/mvtbdata/images/monalisa.png") except (ValueError, urllib.error.URLError) as e: raise unittest.SkipTest(f"Network unavailable: {e}") from e self.assertIsInstance(im, np.ndarray)