diff --git a/hooks/gen_docs/gen_docs_components.py b/hooks/gen_docs/gen_docs_components.py index 6c0c28693..45ca61ae1 100644 --- a/hooks/gen_docs/gen_docs_components.py +++ b/hooks/gen_docs/gen_docs_components.py @@ -212,9 +212,9 @@ def get_sections(component_name: str, *, exist_changes: bool) -> KpopsComponent: ] component_sections_not_inherited: list[ str - ] = DEFAULTS_PIPELINE_COMPONENT_DEPENDENCIES[ # type: ignore [reportGeneralTypeIssues] + ] = DEFAULTS_PIPELINE_COMPONENT_DEPENDENCIES[ component_file_name - ] + ] # type: ignore [reportGeneralTypeIssues] return KpopsComponent(component_sections, component_sections_not_inherited) diff --git a/tests/utils/resources/nested_base_settings.py b/tests/utils/resources/nested_base_settings.py index 53ca54f2e..c73974484 100644 --- a/tests/utils/resources/nested_base_settings.py +++ b/tests/utils/resources/nested_base_settings.py @@ -1,9 +1,10 @@ from pydantic import BaseSettings, Field + class NestedSettings(BaseSettings): attr: str = Field("attr") -class ParentSettings(BaseSettings): +class ParentSettings(BaseSettings): not_nested_field: str = Field("not_nested_field") nested_field: NestedSettings = Field(...) diff --git a/tests/utils/test_doc_gen.py b/tests/utils/test_doc_gen.py index 1af6b2ae7..34b94920b 100644 --- a/tests/utils/test_doc_gen.py +++ b/tests/utils/test_doc_gen.py @@ -1,10 +1,8 @@ -from unittest.mock import ANY from hooks.gen_docs.gen_docs_env_vars import collect_fields from tests.utils.resources.nested_base_settings import ParentSettings -from pydantic.fields import FieldInfo -class TestEnvDocGen: +class TestEnvDocGen: def test_collect_fields(self): collected_field_defaults = [ "not_nested_field", @@ -12,8 +10,6 @@ def test_collect_fields(self): Ellipsis, ] collected_defaults = [ - field.field_info.default - for field - in collect_fields(ParentSettings) + field.field_info.default for field in collect_fields(ParentSettings) ] assert collected_defaults == collected_field_defaults