dosage/tests/conftest.py

27 lines
491 B
Python
Raw Normal View History

# SPDX-License-Identifier: MIT
2020-04-18 11:03:02 +00:00
# Copyright (C) 2019-2020 Tobias Gruetzmacher
2019-12-03 22:52:14 +00:00
import time
from pathlib import Path
2019-12-03 22:52:14 +00:00
import pytest
2020-04-18 11:03:02 +00:00
@pytest.fixture()
def _nosleep(monkeypatch):
2019-12-03 22:52:14 +00:00
def sleep(seconds):
pass
monkeypatch.setattr(time, 'sleep', sleep)
class FakeAppdirs:
@property
def user_data_dir(self):
return str(Path(__file__).parent / 'mocks')
@pytest.fixture()
def _noappdirs(monkeypatch):
monkeypatch.setattr('dosagelib.cmd.userdirs', FakeAppdirs())