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
|
From: Roland Mas <roland.mas@entierement.net>
Date: Tue, 17 Dec 2024 11:09:42 +0100
Subject: Skip tests that require networking
---
pyproject.toml | 5 +++++
src/ewoks/tests/test_install_cli.py | 2 ++
2 files changed, 7 insertions(+)
diff --git a/pyproject.toml b/pyproject.toml
index d711dcf..7db57a8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,8 @@
[build-system]
requires = ["setuptools>=46.4"]
build-backend = "setuptools.build_meta"
+
+[tool.pytest.ini_options]
+markers = [
+ "needs_network: This test requires network access",
+]
diff --git a/src/ewoks/tests/test_install_cli.py b/src/ewoks/tests/test_install_cli.py
index d94d51c..14a7b22 100644
--- a/src/ewoks/tests/test_install_cli.py
+++ b/src/ewoks/tests/test_install_cli.py
@@ -3,6 +3,7 @@ import subprocess
import pytest
+@pytest.mark.needs_network
def test_install(venv):
with pytest.raises(Exception, match="package is not installed"):
venv.get_version("ewoksdata")
@@ -21,6 +22,7 @@ def test_install(venv):
assert venv.get_version("ewoksdata") is not None
+@pytest.mark.needs_network
def test_install_with_extract(venv):
with pytest.raises(Exception, match="package is not installed"):
venv.get_version("ewoksdata")
|