import re


def temp_dir(request, tmpdir_factory):
    """
    Similar to the pytest built-in tmpdir fixture, but returns a string, and with a less horrible name.
    """
    name = re.sub('[\W]', '_', request.node.name)[:30]
    return str(tmpdir_factory.mktemp(name, numbered=True))