import pathlib


def testdata(request):
    """
    If expected data is required for a test this fixture returns the path
    to a folder with name '.testdata' located in the same director as the
    calling test module
    """
    testdata_dir = '.testdata'
    module_dir = pathlib.Path(request.fspath).parent
    return module_dir / testdata_dir