Skip to content

Commit

Permalink
chore: lint and format
Browse files Browse the repository at this point in the history
  • Loading branch information
sujuka99 committed Sep 22, 2023
1 parent b3b01b9 commit 242be4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions hooks/gen_docs/gen_docs_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
3 changes: 2 additions & 1 deletion tests/utils/resources/nested_base_settings.py
Original file line number Diff line number Diff line change
@@ -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(...)
8 changes: 2 additions & 6 deletions tests/utils/test_doc_gen.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
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",
"attr",
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

0 comments on commit 242be4c

Please sign in to comment.