1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
From: Roland Mas <roland.mas@entierement.net>
Date: Thu, 8 May 2025 17:05:32 +0200
Subject: Skip tests that require networking
---
napari_plugin_manager/_tests/test_installer_process.py | 2 ++
napari_plugin_manager/_tests/test_npe2api.py | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/napari_plugin_manager/_tests/test_installer_process.py b/napari_plugin_manager/_tests/test_installer_process.py
index 9b89103..82a8454 100644
--- a/napari_plugin_manager/_tests/test_installer_process.py
+++ b/napari_plugin_manager/_tests/test_installer_process.py
@@ -60,6 +60,7 @@ class _NonExistingTool(AbstractInstallerTool):
return QProcessEnvironment.systemEnvironment()
+@pytest.mark.needs_network
def test_pip_installer_tasks(
qtbot, tmp_virtualenv: 'Session', monkeypatch, caplog
):
@@ -358,6 +359,7 @@ def test_executables():
assert NapariPipInstallerTool.executable()
+@pytest.mark.needs_network
def test_available():
assert str(NapariCondaInstallerTool.available())
assert NapariPipInstallerTool.available()
diff --git a/napari_plugin_manager/_tests/test_npe2api.py b/napari_plugin_manager/_tests/test_npe2api.py
index a981f44..74d73d0 100644
--- a/napari_plugin_manager/_tests/test_npe2api.py
+++ b/napari_plugin_manager/_tests/test_npe2api.py
@@ -8,12 +8,14 @@ from napari_plugin_manager.npe2api import (
plugin_summaries,
)
+import pytest
def test_user_agent():
assert _user_agent()
@flaky(max_runs=4, min_passes=2)
+@pytest.mark.needs_network
def test_plugin_summaries():
keys = [
"name",
@@ -35,6 +37,7 @@ def test_plugin_summaries():
assert not test_data
+@pytest.mark.needs_network
def test_conda_map():
pkgs = ["napari-svg"]
data = conda_map()
@@ -42,12 +45,14 @@ def test_conda_map():
assert pkg in data
+@pytest.mark.needs_network
def test_iter_napari_plugin_info():
data = iter_napari_plugin_info()
for item in data:
assert item
+@pytest.mark.needs_network
def test_clear_cache():
assert _user_agent.cache_info().hits >= 1
cache_clear()
|