fix: make sure tests run async (#5842)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-01-21 13:16:33 -03:00 • committed by GitHub
commit 86b83b0f64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 12 deletions

View file

@ -59,13 +59,14 @@ class ComponentTestBase:
mock_vertex.graph.flow_id = str(uuid4())
source_code = await asyncio.to_thread(inspect.getsource, component_class)
component_instance = component_class(_code=source_code, **default_kwargs)
component_instance._should_process_output = Mock(return_value=False)
component_instance._vertex = mock_vertex
return component_instance
async def test_latest_version(self, component_class: type[Any], default_kwargs: dict[str, Any]) -> None:
"""Test that the component works with the latest version."""
component_instance = await self.component_setup(component_class, default_kwargs)
result = component_instance()
result = await component_instance.run()
assert result is not None, "Component returned None for the latest version."
def test_all_versions_have_a_file_name_defined(self, file_names_mapping: list[VersionComponentMapping]) -> None: