Skip to content

Commit 562666f

Browse files
committed
Fix Lint Errors
1 parent 5a46920 commit 562666f

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

cppython/test/pytest/fixtures.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
CPPythonData,
2121
CPPythonGlobalConfiguration,
2222
CPPythonLocalConfiguration,
23+
GeneratorData,
2324
PEP621Configuration,
2425
PEP621Data,
2526
ProjectConfiguration,
2627
ProjectData,
28+
ProviderData,
2729
PyProject,
2830
ToolData,
2931
)
32+
from cppython.utility.utility import TypeName
3033

3134

3235
@pytest.fixture(
@@ -91,7 +94,9 @@ def fixture_cppython_local_configuration(install_path: Path) -> CPPythonLocalCon
9194
Variation of CPPython data
9295
"""
9396
cppython_local_configuration = CPPythonLocalConfiguration(
94-
install_path=install_path, providers={'mock': {}}, generators={'mock': {}}
97+
install_path=install_path,
98+
providers={TypeName('mock'): ProviderData({})},
99+
generators={TypeName('mock'): GeneratorData({})},
95100
)
96101

97102
return cppython_local_configuration

tests/unit/plugins/conan/test_resolution.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def test_by_name(self) -> None:
286286

287287
assert host_result == mock_host_profile
288288
assert build_result == mock_build_profile
289-
assert mock_conan_api.profiles.get_profile.call_count == 2
289+
assert mock_conan_api.profiles.get_profile.call_count == EXPECTED_PROFILE_CALL_COUNT
290290
mock_conan_api.profiles.get_profile.assert_any_call(['host-profile'])
291291
mock_conan_api.profiles.get_profile.assert_any_call(['build-profile'])
292292

@@ -340,8 +340,8 @@ def test_fallback_to_detect(self, mock_post_process: Mock) -> None:
340340

341341
assert host_result == mock_host_profile
342342
assert build_result == mock_build_profile
343-
assert mock_conan_api.profiles.detect.call_count == 2
344-
assert mock_post_process.call_count == 2
343+
assert mock_conan_api.profiles.detect.call_count == EXPECTED_PROFILE_CALL_COUNT
344+
assert mock_post_process.call_count == EXPECTED_PROFILE_CALL_COUNT
345345
mock_post_process.assert_any_call([mock_host_profile], mock_conan_api, mock_cache_settings, None)
346346
mock_post_process.assert_any_call([mock_build_profile], mock_conan_api, mock_cache_settings, None)
347347

@@ -366,8 +366,8 @@ def test_default_fallback_to_detect(self, mock_post_process: Mock) -> None:
366366

367367
assert host_result == mock_host_profile
368368
assert build_result == mock_build_profile
369-
assert mock_conan_api.profiles.detect.call_count == 2
370-
assert mock_post_process.call_count == 2
369+
assert mock_conan_api.profiles.detect.call_count == EXPECTED_PROFILE_CALL_COUNT
370+
assert mock_post_process.call_count == EXPECTED_PROFILE_CALL_COUNT
371371
mock_post_process.assert_any_call([mock_host_profile], mock_conan_api, mock_cache_settings, None)
372372
mock_post_process.assert_any_call([mock_build_profile], mock_conan_api, mock_cache_settings, None)
373373

0 commit comments

Comments
 (0)