"""Helper functions for testing"""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/36_helper.tests.ipynb.

# %% auto 0
__all__ = []

# %% ../../nbs/36_helper.tests.ipynb 2
import os
from pathlib import Path

# %% ../../nbs/36_helper.tests.ipynb 4
def _test_directory() -> Path:
    """Returns the `nbs/_tests` directory of the `trouver` repository.
    
    Assumes that the current working directory is either the root of the
    repository or the `nbs` folder and the `nbs/_tests` folder exists in the
    repository but the root of the repository does not have a folder named
    `_tests`.
    """
    cwd = os.getcwd()
    cwd_name = os.path.basename(cwd)
    if cwd_name == 'nbs':
        return Path(cwd) / '_tests'
    else:
        return Path(cwd) / 'nbs'/ '_tests'
