File: 0003-Mark-tests-that-require-network-access.patch

package info (click to toggle)
napari 0.6.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,604 kB
  • sloc: python: 109,279; xml: 72; makefile: 42; sh: 5
file content (46 lines) | stat: -rw-r--r-- 1,664 bytes parent folder | download
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
From: Roland Mas <lolando@debian.org>
Date: Sun, 15 Sep 2024 13:58:34 +0200
Subject: Mark tests that require network access

---
 pyproject.toml                                      | 1 +
 src/napari/_qt/_qapp_model/_tests/test_help_menu.py | 1 +
 src/napari_builtins/_tests/test_reader.py           | 1 +
 3 files changed, 3 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index f9ba4f8..5565ba6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -443,6 +443,7 @@ markers = [
     # mark slow tests, so they can be skipped using: pytest -m "not slow"
     "slow: mark a test as slow",
     "key_bindings: Test of keybindings",
+    "needs_network: This test requires network access",
 ]
 
 [tool.mypy]
diff --git a/src/napari/_qt/_qapp_model/_tests/test_help_menu.py b/src/napari/_qt/_qapp_model/_tests/test_help_menu.py
index 3c821d1..8027163 100644
--- a/src/napari/_qt/_qapp_model/_tests/test_help_menu.py
+++ b/src/napari/_qt/_qapp_model/_tests/test_help_menu.py
@@ -11,6 +11,7 @@ from napari._qt._qapp_model.qactions._help import HELP_URLS
 
 
 @pytest.mark.parametrize('url', HELP_URLS.keys())
+@pytest.mark.needs_network
 def test_help_urls(url):
     if url == 'release_notes':
         pytest.skip('No release notes for dev version')
diff --git a/src/napari_builtins/_tests/test_reader.py b/src/napari_builtins/_tests/test_reader.py
index cc99e3d..5bd3013 100644
--- a/src/napari_builtins/_tests/test_reader.py
+++ b/src/napari_builtins/_tests/test_reader.py
@@ -52,6 +52,7 @@ def test_animated_gif_reader(save_image):
 
 
 @pytest.mark.slow
+@pytest.mark.needs_network
 def test_reader_plugin_url():
     layer_data = npe2.read(
         [