Skip tests which requires network connections.

--- a/tests/dispatch.py
+++ b/tests/dispatch.py
@@ -1,9 +1,12 @@
 import unittest
 
+from tests.utils import NETWORK_ACCESSIBLE
 from onlinejudge import dispatch, service
 
+print("XXX: Network accessible is" , NETWORK_ACCESSIBLE)
 
 class DispatchAtCoderTest(unittest.TestCase):
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_problem_from_url(self):
         problem = dispatch.problem_from_url('https://atcoder.jp/contests/arc001/tasks/arc001_1')
         self.assertIsInstance(problem, service.atcoder.AtCoderProblem)
diff --git a/tests/login_service.py b/tests/login_service.py
index 263673a..186443d 100644
--- a/tests/login_service.py
+++ b/tests/login_service.py
@@ -6,6 +6,7 @@ import unittest
 from typing import *
 
 from onlinejudge_api.main import main
+from tests.utils import NETWORK_ACCESSIBLE
 
 ATCODER_USERNAME = 'ATCODER_USERNAME'
 ATCODER_PASSWORD = 'ATCODER_PASSWORD'
@@ -45,6 +46,7 @@ class LoginServiceAtCoderTest(unittest.TestCase):
                 actual = main(['--cookie', str(cookie_path), 'login-service', url], debug=True)
         self.assertEqual(expected, actual)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_login_failure(self) -> None:
         url = 'https://atcoder.jp/'
         expected = {"status": "error", "messages": ["onlinejudge.type.LoginError: failed to login"], "result": None}
@@ -70,6 +72,7 @@ class LoginServiceCodeforcesTest(unittest.TestCase):
                 actual = main(['--cookie', str(cookie_path), 'login-service', url], debug=True)
         self.assertEqual(expected, actual)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_login_failure(self) -> None:
         url = 'https://codeforces.com/'
         expected = {'status': 'error', 'messages': ['onlinejudge.type.LoginError: Invalid handle or password.'], 'result': None}
diff --git a/tests/service_anarchygolf.py b/tests/service_anarchygolf.py
index 9c30096..d0e7922 100644
--- a/tests/service_anarchygolf.py
+++ b/tests/service_anarchygolf.py
@@ -2,6 +2,7 @@ import unittest
 
 from onlinejudge.service.anarchygolf import AnarchyGolfProblem, AnarchyGolfService
 from onlinejudge.type import TestCase
+from tests.utils import NETWORK_ACCESSIBLE
 
 
 class AnarchyGolfServiceTest(unittest.TestCase):
@@ -10,6 +11,7 @@ class AnarchyGolfServiceTest(unittest.TestCase):
         self.assertIsInstance(AnarchyGolfService.from_url('http://golf.shinh.org/p.rb?Indent+Space+Alignment'), AnarchyGolfService)
 
 
+@unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
 class AnarchyGolfProblemTest(unittest.TestCase):
     def test_download_sample_cases(self):
         self.assertEqual(AnarchyGolfProblem.from_url('http://golf.shinh.org/p.rb?last+non+zero').download_sample_cases(), [
diff --git a/tests/service_aoj.py b/tests/service_aoj.py
index 0ee4eb6..e17dbb7 100644
--- a/tests/service_aoj.py
+++ b/tests/service_aoj.py
@@ -2,6 +2,7 @@ import unittest
 
 from onlinejudge.service.aoj import AOJArenaProblem, AOJProblem, AOJService
 from onlinejudge.type import TestCase
+from tests.utils import NETWORK_ACCESSIBLE
 
 
 class AOJSerivceTest(unittest.TestCase):
@@ -20,6 +21,7 @@ class AOJProblemTest(unittest.TestCase):
         self.assertEqual(AOJProblem.from_url('https://onlinejudge.u-aizu.ac.jp/challenges/sources/JAG/Spring/2394?year=2011').problem_id, '2394')
         self.assertIsNone(AOJProblem.from_url('https://onlinejudge.u-aizu.ac.jp/services/room.html#RitsCamp19Day2/problems/A'))
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_sample_cases(self):
         self.assertEqual(AOJProblem.from_url('http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_A').download_sample_cases(), [
             TestCase(name='sample-1', input_name='1', input_data=b'5 12\n0 1 4\n0 2 3\n1 1 2\n1 3 4\n1 1 4\n1 3 2\n0 1 3\n1 2 4\n1 3 0\n0 0 4\n1 0 2\n1 3 0\n', output_name='1', output_data=b'0\n0\n1\n1\n1\n0\n1\n1\n'),
@@ -39,6 +41,7 @@ class AOJProblemTest(unittest.TestCase):
             TestCase(name='sample-1', input_name='1', input_data=b'4\n0 0\n10 0\n10 10\n0 10\n3\n0 0\n1 0\n0 1\n0\n', output_name='1', output_data=b'Case 1: 14.142135624\nCase 2: 1.41421356\n'),
         ])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_sample_cases_not_registered(self):
         # see: https://github.com/kmyk/online-judge-tools/issues/207
         self.assertEqual(AOJProblem.from_url('https://onlinejudge.u-aizu.ac.jp/challenges/sources/ICPC/Regional/1399').download_sample_cases(), [
@@ -57,11 +60,13 @@ class AOJArenaProblemTest(unittest.TestCase):
         self.assertEqual(AOJArenaProblem.from_url('https://onlinejudge.u-aizu.ac.jp/services/room.html#ACPC2018Day2/problems/d').alphabet, 'D')
         self.assertIsNone(AOJArenaProblem.from_url('http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_A'))
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_sample_cases(self):
         self.assertEqual(AOJArenaProblem.from_url('https://onlinejudge.u-aizu.ac.jp/services/room.html#yupro/problems/A').download_sample_cases(), [
             TestCase(name='sample-1', input_name='1', input_data=b'koukyoukoukokukikou\nabrakadabra\nacmicpc\njapaque\nhelloworld\n#\n', output_name='1', output_data=b'0\n2\n4\n5\n7\n'),
         ])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_sample_cases_not_registered(self):
         # see: https://github.com/kmyk/online-judge-tools/issues/207
         self.assertEqual(AOJArenaProblem.from_url('https://onlinejudge.u-aizu.ac.jp/services/room.html#RitsCamp18Day3/problems/B').download_sample_cases(), [
diff --git a/tests/service_atcoder.py b/tests/service_atcoder.py
index e7a1b1d..81b6650 100644
--- a/tests/service_atcoder.py
+++ b/tests/service_atcoder.py
@@ -6,9 +6,10 @@ import requests
 
 from onlinejudge.service.atcoder import AtCoderContest, AtCoderProblem, AtCoderProblemDetailedData, AtCoderService, AtCoderSubmission
 from onlinejudge.type import TestCase
+from tests.utils import NETWORK_ACCESSIBLE
 
 
-class AtCoderSerivceTest(unittest.TestCase):
+class AtCoderServiceTest(unittest.TestCase):
     def test_from_url(self):
         self.assertIsInstance(AtCoderService.from_url('https://atcoder.jp/'), AtCoderService)
         self.assertIsInstance(AtCoderService.from_url('https://beta.atcoder.jp/'), AtCoderService)
@@ -16,6 +17,7 @@ class AtCoderSerivceTest(unittest.TestCase):
         self.assertIsInstance(AtCoderService.from_url('https://atcoder.jp/contests/agc001/submissions/806160'), AtCoderService)
         self.assertIsNone(AtCoderService.from_url('https://codeforces.com/'))
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_iterate_contests(self):
         contests = list(AtCoderService().iterate_contests())
         contest_ids = [contest.contest_id for contest in contests]
@@ -38,6 +40,7 @@ class AtCoderContestTest(unittest.TestCase):
         self.assertEqual(AtCoderContest.from_url('https://atcoder.jp/contests/agc030').contest_id, 'agc030')
         self.assertIsNone(AtCoderContest.from_url('https://atcoder.jp/contests/'))
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_load_details(self):
         contest = AtCoderContest.from_url('https://atcoder.jp/contests/keyence2019')
         time.sleep(0.5)
@@ -67,11 +70,13 @@ class AtCoderContestTest(unittest.TestCase):
         self.assertEqual(data.rated_range, '-')
         self.assertEqual(data.penalty.total_seconds(), 5 * 60)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_get_penalty_a_singular_form(self):
         contest = AtCoderContest.from_url('https://atcoder.jp/contests/chokudai_S002')
         time.sleep(0.5)
         self.assertEqual(contest.download_data().penalty.total_seconds(), 60)  # Penalty is written as "1 minute", not  "1 minutes"
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_list_problems(self):
         contest = AtCoderContest.from_url('https://atcoder.jp/contests/agc028')
         time.sleep(0.5)
@@ -94,6 +99,7 @@ class AtCoderContestTest(unittest.TestCase):
         time.sleep(0.5)
         self.assertEqual(problems[6].problem_id, 'agc028_f2')
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_list_problems_with_float_values(self):
         """
         .. seealso:
@@ -112,6 +118,7 @@ class AtCoderContestTest(unittest.TestCase):
         time.sleep(0.5)
         self.assertEqual(problems[1].download_data().memory_limit_byte, 512 * 1000 * 1000)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_list_problems_time_limit_is_less_than_msec(self):
         contest = AtCoderContest.from_url('https://atcoder.jp/contests/joi2019ho')
         time.sleep(0.5)
@@ -127,6 +134,7 @@ class AtCoderContestTest(unittest.TestCase):
         time.sleep(0.5)
         self.assertEqual(problems[4].download_data().time_limit_msec, 2000)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_list_problems_memory_limit_is_zero(self):
         contest = AtCoderContest.from_url('https://atcoder.jp/contests/future-contest-2019-final-open')
         time.sleep(0.5)
@@ -144,6 +152,7 @@ class AtCoderContestTest(unittest.TestCase):
         self.assertEqual(submissions[0].get_url(), 'https://atcoder.jp/contests/code-festival-2014-exhibition-open/submissions/272697')
         self.assertEqual(submissions[1].get_url(), 'https://atcoder.jp/contests/code-festival-2014-exhibition-open/submissions/272700')
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_get_contest_without_penalty(self):
         contest = AtCoderContest.from_url('https://atcoder.jp/contests/otemae2019')
         time.sleep(0.5)
@@ -188,6 +197,7 @@ class AtCoderProblemTest(unittest.TestCase):
         self.assertEqual(AtCoderProblem.from_url('https://kupc2014.contest.atcoder.jp/tasks/kupc2014_d'), AtCoderProblem.from_url('https://atcoder.jp/contests/kupc2014/tasks/kupc2014_d'))
         self.assertNotEqual(AtCoderProblem.from_url('https://kupc2014.contest.atcoder.jp/tasks/kupc2014_d'), AtCoderProblem.from_url('https://atcoder.jp/contests/agc030/tasks/agc030_c'))
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_load_details(self):
         problem = AtCoderProblem.from_url('https://atcoder.jp/contests/abc118/tasks/abc118_a')
         time.sleep(0.5)
@@ -198,18 +208,21 @@ class AtCoderProblemTest(unittest.TestCase):
         self.assertEqual(data.memory_limit_byte, 1024 * 1000 * 1000)
         self.assertEqual(data.score, 100)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_get_alphabet(self):
         time.sleep(0.5)
         self.assertEqual(AtCoderProblem.from_url('https://atcoder.jp/contests/agc028/tasks/agc028_f').download_data().alphabet, 'F')
         time.sleep(0.5)
         self.assertEqual(AtCoderProblem.from_url('https://atcoder.jp/contests/agc028/tasks/agc028_f2').download_data().alphabet, 'F2')
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_get_score(self):
         time.sleep(0.5)
         self.assertEqual(AtCoderProblem.from_url('https://atcoder.jp/contests/future-contest-2018-final/tasks/future_contest_2018_final_a').download_data().score, 50000000)
         time.sleep(0.5)
         self.assertEqual(AtCoderProblem.from_url('https://atcoder.jp/contests/abc001/tasks/abc001_4').download_data().score, None)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_get_score_latex(self):
         """
         .. seealso::
@@ -219,12 +232,14 @@ class AtCoderProblemTest(unittest.TestCase):
         time.sleep(0.5)
         self.assertIsNone(AtCoderProblem.from_url('https://atcoder.jp/contests/wupc2019/tasks/wupc2019_a').download_data().score)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_get_time_limit_is_less_than_msec(self):
         time.sleep(0.5)
         self.assertEqual(AtCoderProblem.from_url('https://atcoder.jp/contests/joi2019ho/tasks/joi2019ho_c').download_data().time_limit_msec, 500)
         time.sleep(0.5)
         self.assertEqual(AtCoderProblem.from_url('https://atcoder.jp/contests/future-contest-2019-qual/tasks/future_contest_2019_qual_b').download_data().time_limit_msec, 0)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_get_memory_limit_is_zero(self):
         time.sleep(0.5)
         self.assertEqual(AtCoderProblem.from_url('https://atcoder.jp/contests/future-contest-2019-qual/tasks/future_contest_2019_qual_b').download_data().memory_limit_byte, 0)
@@ -247,6 +262,7 @@ class AtCoderSubmissionTest(unittest.TestCase):
         self.assertEqual(AtCoderSubmission.from_url('https://qupc2014.contest.atcoder.jp/submissions/1444440').submission_id, 1444440)
 
 
+@unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
 class AtCoderProblemDataTest(unittest.TestCase):
     def test_from_html_very_old(self):
         url = 'https://atcoder.jp/contests/utpc2011/tasks/utpc2011_1'
@@ -479,6 +495,7 @@ class AtCoderProblemDataTest(unittest.TestCase):
         ])
 
 
+@unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
 class AtCoderProblemGetInputFormatTest(unittest.TestCase):
     def test_normal(self):
         """
diff --git a/tests/service_codechef.py b/tests/service_codechef.py
index c65f08d..0a538e4 100644
--- a/tests/service_codechef.py
+++ b/tests/service_codechef.py
@@ -2,9 +2,10 @@ import unittest
 
 from onlinejudge.service.codechef import CodeChefProblem, CodeChefService
 from onlinejudge.type import TestCase
+from tests.utils import NETWORK_ACCESSIBLE
 
 
-class CodeChefSerivceTest(unittest.TestCase):
+class CodeChefServiceTest(unittest.TestCase):
     def test_from_url(self):
         self.assertIsInstance(CodeChefService.from_url('https://www.codechef.com/'), CodeChefService)
         self.assertIsNone(CodeChefService.from_url('https://www.facebook.com/'))
@@ -15,6 +16,7 @@ class CodeChefProblemTest(unittest.TestCase):
         self.assertEqual(CodeChefProblem.from_url('https://www.codechef.com/COOK113A/problems/DAND').contest_id, 'COOK113A')
         self.assertEqual(CodeChefProblem.from_url('https://www.codechef.com/COOK113A/problems/DAND').problem_id, 'DAND')
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_samples_chfgcd(self):
         url = 'https://www.codechef.com/COOK131B/problems/CHFGCD'
         expected = [
@@ -23,6 +25,7 @@ class CodeChefProblemTest(unittest.TestCase):
         self.assertEqual(CodeChefProblem.from_url(url).download_sample_cases(), expected)
 
     # TODO: support problems with an old format
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     @unittest.expectedFailure
     def test_download_samples_dand(self):
         url = 'https://www.codechef.com/COOK113A/problems/DAND'
@@ -32,6 +35,7 @@ class CodeChefProblemTest(unittest.TestCase):
         self.assertEqual(CodeChefProblem.from_url(url).download_sample_cases(), expected)
 
     # TODO: support problems with an old format
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     @unittest.expectedFailure
     def test_download_samples_cntset(self):
         url = 'https://www.codechef.com/PLIN2020/problems/CNTSET'
@@ -41,6 +45,7 @@ class CodeChefProblemTest(unittest.TestCase):
         self.assertEqual(CodeChefProblem.from_url(url).download_sample_cases(), expected)
 
     # TODO: support problems with an old format
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     @unittest.expectedFailure
     def test_download_samples_acesqn(self):
         url = 'https://www.codechef.com/CNES2017/problems/ACESQN'
diff --git a/tests/service_codeforces.py b/tests/service_codeforces.py
index 39eb452..0dbc6ad 100644
--- a/tests/service_codeforces.py
+++ b/tests/service_codeforces.py
@@ -2,6 +2,7 @@
 import unittest
 
 from onlinejudge.service.codeforces import CodeforcesContest, CodeforcesProblem, CodeforcesService
+from tests.utils import NETWORK_ACCESSIBLE
 
 
 class CodeforcesSerivceTest(unittest.TestCase):
@@ -25,6 +26,7 @@ class CodeforcesContestTest(unittest.TestCase):
         self.assertEqual(CodeforcesContest.from_url('http://m3.codeforces.com/contest/1333').get_url(), CodeforcesContest.from_url('https://codeforces.com/contest/1333').get_url())
         self.assertIsNone(CodeforcesContest.from_url('http://m4.codeforces.com/contest/1333'))
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_list_problems_data(self):
         contest = CodeforcesContest.from_url('https://codeforces.com/contest/1157')
         problems = contest.list_problem_data()
@@ -38,6 +40,7 @@ class CodeforcesContestTest(unittest.TestCase):
         self.assertEqual(problems[6].tags, ['constructive algorithms', 'dp', 'greedy', 'two pointers'])
         self.assertEqual(problems[7].tags, ['brute force', 'constructive algorithms'])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_list_problems(self):
         contest = CodeforcesContest.from_url('https://codeforces.com/contest/1157')
         problems = contest.list_problems()
@@ -46,6 +49,7 @@ class CodeforcesContestTest(unittest.TestCase):
         self.assertEqual(problems[6].get_url(), 'https://codeforces.com/contest/1157/problem/F')
         self.assertEqual(problems[7].download_data().tags, ['brute force', 'constructive algorithms'])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_data(self):
         contest = CodeforcesContest.from_url('http://codeforces.com/contest/1200')
         data = contest.download_data()
@@ -57,6 +61,7 @@ class CodeforcesContestTest(unittest.TestCase):
         self.assertEqual(data.type, 'CF')
 
 
+@unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
 class CodeforcesProblemTest(unittest.TestCase):
     def test_from_url(self):
         self.assertEqual(CodeforcesProblem.from_url('http://codeforces.com/problemset/problem/700/B').contest_id, 700)
diff --git a/tests/service_google.py b/tests/service_google.py
index d26220d..2cc8544 100644
--- a/tests/service_google.py
+++ b/tests/service_google.py
@@ -3,6 +3,7 @@ import unittest
 
 from onlinejudge.service.google import GoogleCodeJamProblem, GoogleCodeJamService
 from onlinejudge.type import TestCase
+from tests.utils import NETWORK_ACCESSIBLE
 
 
 class GoogleCodeJamSerivceTest(unittest.TestCase):
@@ -42,6 +43,7 @@ class GoogleCodeJamProblemTest(unittest.TestCase):
         self.assertEqual(problem.contest_id, '8404486')
         self.assertEqual(problem.problem_id, 'p0')
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_samples_codejam(self):
         problem = GoogleCodeJamProblem.from_url('https://codingcompetitions.withgoogle.com/codejam/round/000000000019fd27/000000000020993c')
         sample_input = textwrap.dedent("""\
@@ -76,6 +78,7 @@ class GoogleCodeJamProblemTest(unittest.TestCase):
             ),
         ])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_samples_kickstart(self):
         problem = GoogleCodeJamProblem.from_url('https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ffc7/00000000001d3f56')
         sample_input = textwrap.dedent("""\
@@ -102,6 +105,7 @@ class GoogleCodeJamProblemTest(unittest.TestCase):
             ),
         ])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_multiple_samples(self):
         problem = GoogleCodeJamProblem.from_url('https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ffc7/00000000001d3ff3')
         sample_input1 = textwrap.dedent("""\
diff --git a/tests/service_library_checker.py b/tests/service_library_checker.py
index d731df2..e1c9a6d 100644
--- a/tests/service_library_checker.py
+++ b/tests/service_library_checker.py
@@ -6,6 +6,7 @@ import unittest
 import onlinejudge.utils
 from onlinejudge.service.library_checker import LibraryCheckerProblem, LibraryCheckerService
 from onlinejudge.type import TestCase
+from tests.utils import NETWORK_ACCESSIBLE
 
 
 @contextlib.contextmanager
@@ -30,12 +31,14 @@ class LibraryCheckerProblemTest(unittest.TestCase):
         self.assertEqual(LibraryCheckerProblem.from_url('https://judge.yosupo.jp/problem/point_add_range_sum').problem_id, 'point_add_range_sum')
 
     @unittest.skipIf(os.name == 'nt', "Library Checker is not supported on Windows")
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_samples(self):
         self.assertEqual(LibraryCheckerProblem.from_url('https://judge.yosupo.jp/problem/unionfind').download_sample_cases(), [
             TestCase(name='example_00', input_name='example_00.in', input_data=b'4 7\n1 0 1\n0 0 1\n0 2 3\n1 0 1\n1 1 2\n0 0 2\n1 1 3\n', output_name='example_00.out', output_data=b'0\n1\n0\n1\n'),
         ])
 
     @unittest.skipIf(os.name == 'nt', "Library Checker is not supported on Windows")
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_pull_repository(self):
         # reset
         LibraryCheckerService.is_repository_updated = False
diff --git a/tests/service_spoj.py b/tests/service_spoj.py
index 804b1c2..b39947f 100644
--- a/tests/service_spoj.py
+++ b/tests/service_spoj.py
@@ -2,6 +2,7 @@ import unittest
 
 from onlinejudge.service.spoj import SPOJProblem, SPOJService
 from onlinejudge.type import TestCase
+from tests.utils import NETWORK_ACCESSIBLE
 
 
 class SPOJSerivceTest(unittest.TestCase):
@@ -14,11 +15,13 @@ class SPOJProblemTest(unittest.TestCase):
     def test_from_url(self):
         self.assertEqual(SPOJProblem.from_url('https://www.spoj.com/problems/ACARGO/').problem_id, 'ACARGO')
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_samples(self):
         self.assertEqual(SPOJProblem.from_url('https://www.spoj.com/problems/ACARGO/').download_sample_cases(), [
             TestCase(name='sample-1', input_name='Sample Input:', input_data=b'3 5\n0\n1\n3\n2 3\n0\n1\n5 20\n2\n7\n12\n9\n13\n0 0\n', output_name='Sample Output:', output_data=b'1\n0\n10\n'),
         ])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_samples_todo(self):
         # No samples found.
         self.assertFalse(SPOJProblem.from_url('https://www.spoj.com/problems/MKLABELS/').download_sample_cases())
diff --git a/tests/service_yukicoder.py b/tests/service_yukicoder.py
index 658fea2..b971743 100644
--- a/tests/service_yukicoder.py
+++ b/tests/service_yukicoder.py
@@ -4,6 +4,7 @@ import unittest
 from onlinejudge.service.yukicoder import YukicoderContest, YukicoderProblem, YukicoderService
 from onlinejudge.type import *
 from tests.implementation_utils import get_handmade_sample_cases
+from tests.utils import NETWORK_ACCESSIBLE
 
 
 class YukicoderServiceTest(unittest.TestCase):
@@ -20,6 +21,7 @@ class YukicoderProblemTest(unittest.TestCase):
         self.assertEqual(YukicoderProblem.from_url('http://yukicoder.me/problems/no/123/').problem_no, 123)
         self.assertEqual(YukicoderProblem.from_url('http://yukicoder.me/problems/123').problem_id, 123)
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_sample_cases(self):
         self.assertEqual(YukicoderProblem.from_url('http://yukicoder.me/problems/no/9000').download_sample_cases(), [
             TestCase(name='sample-1', input_name='サンプル1 入力', input_data=b'yukicoder\n', output_name='サンプル1 出力', output_data=b'Hello World!\n'),
@@ -45,6 +47,7 @@ class YukicoderProblemTest(unittest.TestCase):
             TestCase(name='sample-4', input_name='サンプル4 入力', input_data=b'\n', output_name='サンプル4 出力', output_data=b'1\n'),
         ])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_sample_cases_issue_355(self):
         # see https://github.com/kmyk/online-judge-tools/issues/355
         self.assertEqual(YukicoderProblem.from_url('https://yukicoder.me/problems/no/649').download_sample_cases(), [
@@ -54,6 +57,7 @@ class YukicoderProblemTest(unittest.TestCase):
             TestCase(name='sample-4', input_name='サンプル4 入力', input_data=b'1 1\n2\n', output_name='サンプル4 出力', output_data=b'-1\n'),
         ])
 
+    @unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
     def test_download_sample_cases_issue_192(self):
         # see https://github.com/kmyk/online-judge-tools/issues/192
         self.assertEqual(YukicoderProblem.from_url('https://yukicoder.me/problems/no/750').download_sample_cases(), [
@@ -128,6 +132,7 @@ class YukicoderProblemTest(unittest.TestCase):
         ])
 
 
+@unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
 class YukicoderContestTest(unittest.TestCase):
     def test_from_url(self):
         self.assertEqual(YukicoderContest.from_url('https://yukicoder.me/contests/276').contest_id, 276)
@@ -144,6 +149,7 @@ class YukicoderContestTest(unittest.TestCase):
         ])
 
 
+@unittest.skipIf(not NETWORK_ACCESSIBLE, "Network access required but not available")
 class YukicoderProblemGetInputFormatTest(unittest.TestCase):
     def test_normal(self):
         self.assertEqual(YukicoderProblem.from_url('https://yukicoder.me/problems/no/1').get_input_format(), '\\(N\\)\n\\(C\\)\n\\(V\\)\n\\(S_1\\ S_2\\ S_3\\ \\dots\\ S_V\\)\n\\(T_1\\ T_2\\ T_3\\ \\dots\\ T_V\\)\n\\(Y_1\\ Y_2\\ Y_3\\ \\dots\\ Y_V\\)\n\\(M_1\\ M_2\\ M_3\\ \\dots\\ M_V\\)\n')
diff --git a/tests/utils.py b/tests/utils.py
index 6a34fa3..e858f70 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -1,3 +1,8 @@
+import os
+import socket
+
+import requests
+
 import onlinejudge.dispatch as dispatch
 from onlinejudge_api.main import main
 
@@ -12,3 +17,15 @@ def is_logged_in(url: str, *, memo={}) -> bool:
         result = main(['login-service', '--check', url], debug=True)
         memo[url] = bool((result.get('result') or {}).get('loggedIn'))
     return memo[url]
+
+
+def can_reach_internet():
+    """Check if we can actually reach the internet"""
+    try:
+        socket.create_connection(("google.com", 443), timeout=5)
+        return True
+    except Exception:
+        return False
+
+
+NETWORK_ACCESSIBLE = os.getenv("RUN_NETWORK_TESTS", "1") == "1" and can_reach_internet()
-- 
2.51.0

