def make_edalize_test(monkeypatch, tmpdir):
    """A factory fixture to make an edalize backend with work_root directory

    The returned factory method takes a `tool_name` (the name of the tool) and
    the keyword arguments supported by :class:`TestFixture`. It returns a
    :class:`TestFixture` object, whose `work_root` is a temporary directory.

    """
    # Prepend directory `mock_commands` to PATH environment variable
    monkeypatch.setenv("PATH", os.path.join(tests_dir, "mock_commands"), ":")

    created = []

    def _fun(tool_name, **kwargs):
        work_root = tmpdir / str(len(created))
        work_root.mkdir()
        fixture = TestFixture(tool_name, str(work_root), **kwargs)
        created.append(fixture)
        return fixture

    return _fun