From b0465cb7f26ac4d54849207a671506675e0f2355 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 26 Jan 2022 17:15:35 -0700 Subject: [PATCH] Restoring pytest fixture so PyCharm can find fixtures. --- modules/videos/downloader.py | 2 +- wrolpi/conftest.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/videos/downloader.py b/modules/videos/downloader.py index 8b8138d8..0e072ef2 100755 --- a/modules/videos/downloader.py +++ b/modules/videos/downloader.py @@ -93,7 +93,7 @@ class ChannelDownloader(Downloader, ABC): YT_DLP_BIN = pathlib.Path('/usr/local/bin/yt-dlp') # Location in docker container if not YT_DLP_BIN.is_file(): YT_DLP_BIN = pathlib.Path('/opt/wrolpi/venv/bin/yt-dlp') # Use virtual environment location -if not YT_DLP_BIN.is_file(): +if not YT_DLP_BIN.is_file() and not PYTEST: logger.error('COULD NOT FIND YT-DLP!!!') diff --git a/wrolpi/conftest.py b/wrolpi/conftest.py index fede0150..c8d72b87 100644 --- a/wrolpi/conftest.py +++ b/wrolpi/conftest.py @@ -9,7 +9,6 @@ from unittest import mock from uuid import uuid1 import pytest -import pytest_asyncio import yaml from sanic_testing.testing import SanicTestClient from sqlalchemy.engine import Engine, create_engine @@ -52,7 +51,7 @@ def test_db() -> Tuple[Engine, Session]: return test_engine, session -@pytest_asyncio.fixture() +@pytest.fixture() def test_session() -> Session: """ Pytest Fixture to get a test database session. @@ -75,7 +74,7 @@ def test_session() -> Session: conn.close() -@pytest_asyncio.fixture(autouse=True) +@pytest.fixture(autouse=True) def test_directory() -> pathlib.Path: """ Overwrite the media directory with a temporary directory. @@ -87,7 +86,7 @@ def test_directory() -> pathlib.Path: yield tmp_path -@pytest_asyncio.fixture(autouse=True) +@pytest.fixture(autouse=True) def test_config(): """ Create a test config based off the example config.