aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2019-01-22 02:13:29 -0600
committerTim Harder <radhermit@gmail.com>2019-01-22 02:13:29 -0600
commit4cde997f7ff7ea79a42f15cad4253456bfa9033a (patch)
tree9f132f8729cc532eba1e794e8639c38e059c6519 /tests/conftest.py
parenttests/sync: TestVcsSyncer: fix basedir file error check (diff)
downloadpkgcore-4cde997f7ff7ea79a42f15cad4253456bfa9033a.tar.gz
pkgcore-4cde997f7ff7ea79a42f15cad4253456bfa9033a.tar.bz2
pkgcore-4cde997f7ff7ea79a42f15cad4253456bfa9033a.zip
tests: add initial conftest.py that adds pytest.mark.network decorator
For marking tests that require the network to be skipped by default except if the --network option is passed.
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
new file mode 100644
index 00000000..c69cdd9a
--- /dev/null
+++ b/tests/conftest.py
@@ -0,0 +1,13 @@
+import pytest
+
+
+def pytest_addoption(parser):
+ parser.addoption(
+ '--network', action='store_true', dest="network",
+ default=False, help="enable network mark decorated tests")
+
+
+def pytest_configure(config):
+ pytest.mark.network = pytest.mark.skipif(
+ not config.option.network,
+ reason="needs --network option to run")