mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[V3] Make pytest fixtures available as a plugin (#1858)
* Move all fixtures to pytest plugin folder * Add core dunder all * Update other dunder all's * Black reformat
This commit is contained in:
@@ -3,28 +3,10 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from redbot.pytest.data_manager import *
|
||||
from redbot.core import data_manager
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def cleanup_datamanager():
|
||||
data_manager.basic_config = None
|
||||
data_manager.jsonio = None
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def data_mgr_config(tmpdir):
|
||||
default = data_manager.basic_config_default.copy()
|
||||
default["BASE_DIR"] = str(tmpdir)
|
||||
return default
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def cog_instance():
|
||||
thing = type("CogTest", (object,), {})
|
||||
return thing()
|
||||
|
||||
|
||||
def test_no_basic(cog_instance):
|
||||
with pytest.raises(RuntimeError):
|
||||
data_manager.core_data_path()
|
||||
|
||||
Reference in New Issue
Block a user