Clean up docstrings in conftest

This commit is contained in:
Veronica Berglyd Olsen
2024-01-11 09:23:05 +01:00
parent 5c99e2186a
commit fa9d0f3503
+7 -7
View File
@@ -63,7 +63,7 @@ def resetConfigVars():
@pytest.fixture(scope="session", autouse=True) @pytest.fixture(scope="session", autouse=True)
def sessionFixture(): def sessionFixture():
"""A session wide fixture to set up the test environment.""" """A default session wide fixture to set up the test environment."""
logging.root.setLevel(logging.INFO) logging.root.setLevel(logging.INFO)
if _TMP_ROOT.exists(): if _TMP_ROOT.exists():
shutil.rmtree(_TMP_ROOT) shutil.rmtree(_TMP_ROOT)
@@ -74,8 +74,10 @@ def sessionFixture():
@pytest.fixture(scope="function", autouse=True) @pytest.fixture(scope="function", autouse=True)
def functionFixture(qtbot): def functionFixture(qtbot):
"""Ensures that the main Qt thread is always available, and reset """A default function fixture that:
the config object for each function and redirect its storage paths. * Ensures that the main Qt thread is always available
* Resets the config object for each function and redirect its
storage paths to temporary test folders.
""" """
if _TMP_CONF.exists(): if _TMP_CONF.exists():
shutil.rmtree(_TMP_CONF) shutil.rmtree(_TMP_CONF)
@@ -95,7 +97,7 @@ def functionFixture(qtbot):
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def tstPaths(): def tstPaths():
"""Returns an object that can provide the various paths needed for """Return an object that can provide the various paths needed for
running tests. running tests.
""" """
class _Store: class _Store:
@@ -124,9 +126,7 @@ def fncPath():
@pytest.fixture(scope="function") @pytest.fixture(scope="function")
def projPath(fncPath): def projPath(fncPath):
"""A temporary folder for a single test function, """A temp folder for a single test function + project folder."""
with a project folder.
"""
prjDir = fncPath / "project" prjDir = fncPath / "project"
if prjDir.exists(): if prjDir.exists():
shutil.rmtree(prjDir) shutil.rmtree(prjDir)