From: Roland Mas <roland.mas@entierement.net>
Date: Tue, 17 Dec 2024 12:09:40 +0100
Subject: Skip tests that require networking

---
 pytest.ini       | 2 ++
 tests/test_it.py | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/pytest.ini b/pytest.ini
index 557dc4d..4f8be3c 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -3,3 +3,5 @@ python_files = test_*.py
 testpaths =
     src/pytest_venv
     tests
+markers =
+    needs_network: This test requires network access
diff --git a/tests/test_it.py b/tests/test_it.py
index dbb0f8e..f5f4cc3 100644
--- a/tests/test_it.py
+++ b/tests/test_it.py
@@ -13,16 +13,19 @@ def test_it(venv):
     assert result.strip() == b'hello world'
 
 
+@pytest.mark.needs_network
 def test_it_installs_dep(venv):
     venv.install('webob')
     subprocess.check_call([venv.python, '-c', 'import webob'])
 
 
+@pytest.mark.needs_network
 def test_it_installs_dep_with_extra_args(venv):
     venv.install('webob', extra_args=['--prefer-binary'])
     subprocess.check_call([venv.python, '-c', 'import webob'])
 
 
+@pytest.mark.needs_network
 @pytest.mark.skipif(
     sys.version_info < (3, 12), reason="Make sense only for Python 3.12"
 )
@@ -36,12 +39,14 @@ def test_it_installs_dep_without_setuptools(venv):
     venv.get_version('micropipenv')
 
 
+@pytest.mark.needs_network
 def test_it_installs_editable_dep(venv):
     venv.install(os.path.join(here, 'myapp'), editable=True)
     result = subprocess.check_output([venv.python, '-c', 'import myapp'])
     assert result.strip() == b'hello world'
 
 
+@pytest.mark.needs_network
 def test_it_upgrades_dep(venv):
     venv.install('pyramid==1.6')
     version1 = venv.get_version('pyramid')
