diff options
author | Tim Harder <radhermit@gmail.com> | 2019-01-22 02:13:29 -0600 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2019-01-22 02:13:29 -0600 |
commit | 4cde997f7ff7ea79a42f15cad4253456bfa9033a (patch) | |
tree | 9f132f8729cc532eba1e794e8639c38e059c6519 /tests/conftest.py | |
parent | tests/sync: TestVcsSyncer: fix basedir file error check (diff) | |
download | pkgcore-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.py | 13 |
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") |