mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-03 23:15:18 -04:00
Move GUI tests into tests/ dir and fix conftest related stuff so everything loads what it needs and passes
This commit is contained in:
parent
1043be4483
commit
10cdfa7631
31 changed files with 25 additions and 189 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue