mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-06 08:25:15 -04:00
Make it so GUI tests only run with --rungui
This commit is contained in:
parent
67982ac133
commit
ecc9ef705a
33 changed files with 68 additions and 7 deletions
|
@ -11,19 +11,28 @@ import pytest
|
|||
from onionshare import common, web, settings, strings
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--rungui", action="store_true", default=False, help="run GUI tests"
|
||||
)
|
||||
parser.addoption(
|
||||
"--runtor", action="store_true", default=False, help="run tor tests"
|
||||
)
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(config, items):
|
||||
if config.getoption("--runtor"):
|
||||
if not config.getoption("--runtor"):
|
||||
# --runtor given in cli: do not skip tor tests
|
||||
return
|
||||
skip_tor = pytest.mark.skip(reason="need --runtor option to run")
|
||||
for item in items:
|
||||
if "tor" in item.keywords:
|
||||
item.add_marker(skip_tor)
|
||||
skip_tor = pytest.mark.skip(reason="need --runtor option to run")
|
||||
for item in items:
|
||||
if "tor" in item.keywords:
|
||||
item.add_marker(skip_tor)
|
||||
|
||||
if not config.getoption('--rungui'):
|
||||
# --rungui given in cli: do not skip GUI tests
|
||||
skip_gui = pytest.mark.skip(reason="need --rungui option to run")
|
||||
for item in items:
|
||||
if "gui" in item.keywords:
|
||||
item.add_marker(skip_gui)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue