def _build_config_for_path(path):
<EOL>for rootdir in path.parts(reverse=True):<EOL><INDENT>if rootdir.join("<STR_LIT>").exists():<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>rootdir = path<EOL><DEDENT>pluginmanager = PytestPluginManager()<EOL>for spec in default_plugins:<EOL><INDENT>pluginmanager.import_plugin(spec)<EOL><DEDENT>config = Config(pluginmanager)<EOL>args = [rootdir]<EOL>config.parse(args)<EOL>return config<EOL>
Builds and returns a basic test configuration rooted at the given path.

Args:
    path (LocalPath): The path to the files under test.

Returns:
    Config: The generated test configuration.