Skip to content

Commit 924990b

Browse files
committed
config: move default interactive value to validate_config()
Per @ryneeverett's request, the value should be removed from the schema.py. Doing so required changing some of the tests.
1 parent 737ae33 commit 924990b

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

bugwarrior/config/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class MainSectionConfig(BaseConfig):
138138

139139
# added during configuration loading
140140
#: Interactive status.
141-
interactive: bool = False
141+
interactive: bool
142142

143143
@computed_field
144144
@property

bugwarrior/config/validation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def validate_config(config: dict, main_section: str, config_path: str) -> "Confi
189189
f"[{flavor_name}]\ntargets = {flavor.targets} <- No [{target}] section found\n"
190190
)
191191

192-
main = flavors.get(main_section, MainSectionConfig(targets=[]))
192+
main = flavors.get(main_section, MainSectionConfig(targets=[], interactive=False))
193193
filtered_service_configs = [
194194
service_config
195195
for service_config in service_configs

tests/config/test_validation.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ def test_deprecated_project_name(self):
141141
self.validate()
142142

143143
def test_flavors(self):
144-
self.config['flavor'] = {'myflavor': {'targets': ['my_service', 'my_gitlab']}}
144+
self.config['flavor'] = {
145+
'myflavor': {'targets': ['my_service', 'my_gitlab'], 'interactive': False}
146+
}
145147
self.validate()
146148

147149
def test_quoted_flavor_key_error(self):
@@ -175,6 +177,10 @@ def test_load_and_validate_example_files(self):
175177
for main_section, expected_configs in expected_by_flavor.items():
176178
with self.subTest(config=config_path.name, main_section=main_section):
177179
formatted_config = parse_file(str(config_path))
180+
181+
for flavor in formatted_config['flavor'].values():
182+
flavor['interactive'] = False
183+
178184
config = validation.validate_config(
179185
formatted_config, main_section, str(config_path)
180186
)

0 commit comments

Comments
 (0)