From: Roland Mas <roland.mas@entierement.net>
Date: Fri, 15 Nov 2024 16:01:38 +0100
Subject: Skip tests that require networking

---
 pyproject.toml                    | 3 +++
 tests/test_qt/test_demos.py       | 1 +
 tests/test_qt/test_qmainwindow.py | 2 ++
 tests/test_qt/test_qmenu.py       | 2 ++
 4 files changed, 8 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index 3376232..e0c95c6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -156,6 +156,9 @@ filterwarnings = [
     "ignore:Failing to pass a value to the 'type_params' parameter::pydantic",
     "ignore:`__get_validators__` is deprecated and will be removed",
 ]
+markers = [
+    "needs_network: This test requires network access",
+]
 
 # https://mypy.readthedocs.io/en/stable/config_file.html
 [tool.mypy]
diff --git a/tests/test_qt/test_demos.py b/tests/test_qt/test_demos.py
index 7fa13ae..3cf17e7 100644
--- a/tests/test_qt/test_demos.py
+++ b/tests/test_qt/test_demos.py
@@ -7,6 +7,7 @@ from qtpy.QtWidgets import QApplication
 DEMO = Path(__file__).parent.parent.parent / "demo"
 
 
+@pytest.mark.needs_network
 @pytest.mark.parametrize("fname", ["qapplication.py", "model_app.py", "multi_file"])
 def test_qapp(qapp, fname, monkeypatch) -> None:
     monkeypatch.setattr(QApplication, "exec", lambda *a, **k: None)
diff --git a/tests/test_qt/test_qmainwindow.py b/tests/test_qt/test_qmainwindow.py
index a31b137..e2a8771 100644
--- a/tests/test_qt/test_qmainwindow.py
+++ b/tests/test_qt/test_qmainwindow.py
@@ -2,6 +2,7 @@ from __future__ import annotations
 
 from typing import TYPE_CHECKING
 
+import pytest
 from qtpy.QtCore import Qt
 from qtpy.QtWidgets import QAction, QApplication
 
@@ -14,6 +15,7 @@ if TYPE_CHECKING:
     from ..conftest import FullApp  # noqa: TID252
 
 
+@pytest.mark.needs_network
 def test_qmodel_main_window(
     qtbot: QtBot, qapp: QApplication, full_app: FullApp
 ) -> None:
diff --git a/tests/test_qt/test_qmenu.py b/tests/test_qt/test_qmenu.py
index 359a484..3175f4e 100644
--- a/tests/test_qt/test_qmenu.py
+++ b/tests/test_qt/test_qmenu.py
@@ -18,6 +18,7 @@ SEP = ""
 LINUX = sys.platform.startswith("linux")
 
 
+@pytest.mark.needs_network
 @pytest.mark.parametrize("MenuCls", [QModelMenu, QModelToolBar])
 def test_menu(
     MenuCls: type[QModelMenu] | type[QModelToolBar], qtbot: QtBot, full_app: FullApp
@@ -151,6 +152,7 @@ def test_toggled_menu_item(qtbot: QtBot, full_app: FullApp) -> None:
     assert not action.isChecked()
 
 
+@pytest.mark.needs_network
 @pytest.mark.parametrize("MenuCls", [QModelMenu, QModelToolBar])
 def test_menu_events(
     MenuCls: type[QModelMenu] | type[QModelToolBar], qtbot: QtBot, full_app: FullApp
