Restoring pytest fixture so PyCharm can find fixtures.

This commit is contained in:
Roland 2022-01-26 17:15:35 -07:00
parent 3dda813b9e
commit b0465cb7f2
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 4 additions and 5 deletions

View file

@ -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!!!')

View file

@ -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.