bandcamp-importer/test/conftest.py
evilchili b682c9f945 v1.0
2024-04-12 14:43:24 -07:00

33 lines
660 B
Python

import os
from pathlib import Path
import pytest
@pytest.fixture(autouse=True)
def fixtures():
return Path(__file__).parent / "fixtures"
@pytest.fixture
def media_root(tmp_path_factory):
return tmp_path_factory.mktemp('media')
@pytest.fixture
def main_args(media_root, fixtures):
return {
'verbose': True,
'log_level': 'DEBUG',
'media_root': media_root,
'downloads': fixtures / "downloads",
'config_file': fixtures / 'bandcamp-importer.conf',
}
@pytest.fixture(autouse=True)
def mock_env(monkeypatch, fixtures, media_root):
if 'LOG_LEVEL' in os.environ:
del os.environ['LOG_LEVEL']