dosage/tests/conftest.py
Tobias Gruetzmacher d487485815 Read scraper modules from user data directory
This allows users to add scrapers without setting up a complete Python
development environment.
2020-10-04 23:46:57 +02:00

26 lines
491 B
Python

# SPDX-License-Identifier: MIT
# Copyright (C) 2019-2020 Tobias Gruetzmacher
import time
from pathlib import Path
import pytest
@pytest.fixture()
def _nosleep(monkeypatch):
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())