Skip to content

Commit 78c5987

Browse files
committed
Update shared.py
1 parent 8f2378c commit 78c5987

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

cppython/test/pytest/shared.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ def fixture_plugin_group_data(
256256
The plugin configuration
257257
"""
258258
project_data.project_root = tmp_path_factory.mktemp('workspace-')
259-
259+
# Install path is already pinned to a temp directory to share downloaded resources
260+
cppython_plugin_data.build_path = project_data.project_root / 'build'
261+
cppython_plugin_data.tool_path = project_data.project_root / 'tool'
260262
return resolve_provider(project_data=project_data, cppython_data=cppython_plugin_data)
261263

262264
@staticmethod
@@ -331,17 +333,22 @@ def fixture_plugin_configuration_type() -> type[GeneratorPluginGroupData]:
331333
@staticmethod
332334
@pytest.fixture(name='plugin_group_data', scope='session')
333335
def fixture_plugin_group_data(
334-
project_data: ProjectData, cppython_plugin_data: CPPythonPluginData
336+
project_data: ProjectData, cppython_plugin_data: CPPythonPluginData, tmp_path_factory: pytest.TempPathFactory
335337
) -> GeneratorPluginGroupData:
336338
"""Generates plugin configuration data generation from environment configuration
337339
338340
Args:
339341
project_data: The project data fixture
340342
cppython_plugin_data:The plugin configuration fixture
343+
tmp_path_factory: The temporary path factory
341344
342345
Returns:
343346
The plugin configuration
344347
"""
348+
project_data.project_root = tmp_path_factory.mktemp('workspace-')
349+
# Install path is already pinned to a temp directory to share downloaded resources
350+
cppython_plugin_data.build_path = project_data.project_root / 'build'
351+
cppython_plugin_data.tool_path = project_data.project_root / 'tool'
345352
return resolve_generator(project_data=project_data, cppython_data=cppython_plugin_data)
346353

347354
@staticmethod
@@ -415,17 +422,22 @@ def fixture_plugin_configuration_type() -> type[SCMPluginGroupData]:
415422
@staticmethod
416423
@pytest.fixture(name='plugin_group_data', scope='session')
417424
def fixture_plugin_group_data(
418-
project_data: ProjectData, cppython_plugin_data: CPPythonPluginData
425+
project_data: ProjectData, cppython_plugin_data: CPPythonPluginData, tmp_path_factory: pytest.TempPathFactory
419426
) -> SCMPluginGroupData:
420427
"""Generates plugin configuration data generation from environment configuration
421428
422429
Args:
423430
project_data: The project data fixture
424431
cppython_plugin_data:The plugin configuration fixture
432+
tmp_path_factory: The temporary path factory
425433
426434
Returns:
427435
The plugin configuration
428436
"""
437+
project_data.project_root = tmp_path_factory.mktemp('workspace-')
438+
# Install path is already pinned to a temp directory to share downloaded resources
439+
cppython_plugin_data.build_path = project_data.project_root / 'build'
440+
cppython_plugin_data.tool_path = project_data.project_root / 'tool'
429441
return resolve_scm(project_data=project_data, cppython_data=cppython_plugin_data)
430442

431443
@staticmethod

0 commit comments

Comments
 (0)