musicube/test/conftest.py

20 lines
485 B
Python

import sys
from pathlib import Path
import pytest
from pytest_mock import MockerFixture
# Add source to PATH such that imports within src modules are properly resolved.
SRC_PATH = str(Path(__file__).parent / '..' / 'src')
sys.path.insert(0, SRC_PATH)
@pytest.fixture
def bot(mocker: MockerFixture):
yield mocker.patch('discord.ext.commands.Bot', autospec=True)
@pytest.fixture
def ctx(mocker: MockerFixture):
yield mocker.patch('discord.ext.commands.Context', autospec=True)