Move GUI tests into tests/ dir and fix conftest related stuff so everything loads what it needs and passes

This commit is contained in:
Miguel Jacq 2018-10-13 10:35:09 +11:00
parent 1043be4483
commit 10cdfa7631
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
31 changed files with 25 additions and 189 deletions

View file

@ -10,6 +10,22 @@ import pytest
from onionshare import common, web, settings, strings
def pytest_addoption(parser):
parser.addoption(
"--runtor", action="store_true", default=False, help="run tor tests"
)
def pytest_collection_modifyitems(config, items):
if 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)
@pytest.fixture
def temp_dir_1024():
""" Create a temporary directory that has a single file of a
@ -151,13 +167,11 @@ def time_strftime(monkeypatch):
@pytest.fixture
def common_obj():
_common = common.Common()
_common.settings = settings.Settings(_common)
strings.load_strings(_common)
return _common
return common.Common()
@pytest.fixture
def settings_obj(sys_onionshare_dev_mode, platform_linux):
_common = common.Common()
_common.version = 'DUMMY_VERSION_1.2.3'
strings.load_strings(_common)
return settings.Settings(_common)