Skip to content

config: set default on missing default_context key#1516

Merged
simobasso merged 1 commit intocookiecutter:masterfrom
simobasso:bugfix/set_default_on_default_context
Apr 29, 2021
Merged

config: set default on missing default_context key#1516
simobasso merged 1 commit intocookiecutter:masterfrom
simobasso:bugfix/set_default_on_default_context

Conversation

@simobasso
Copy link
Copy Markdown
Member

@simobasso simobasso commented Apr 11, 2021

Closes: #1514
Closes: #1149

@acturner
Copy link
Copy Markdown

acturner commented Apr 11, 2021

EDIT: Fixed #1514 but not #1513 (the latter error coming from poyo).

For testing, you can clone cookiecutter-value-error and then run:

cookiecutter cookiecutter-value-error --config-file=cookiecutter-value-error/init.yaml --no-input

@simobasso
Copy link
Copy Markdown
Member Author

@acturner thanks, just updated the description and also, I've found #1149 that seems the same issue.

@simobasso simobasso force-pushed the bugfix/set_default_on_default_context branch from 4609471 to cc92e3c Compare April 22, 2021 22:01
@glumia
Copy link
Copy Markdown
Contributor

glumia commented Apr 24, 2021

lgtm!

The fact you had to update both tests/test_get_config.py::test_get_config and tests/test_get_user_config.py::custom_config after editing tests/test-config/valid-config.yaml is a clear sign of code duplication, we should have a single fixture as source of truth of file's content. @simobasso do you think it would be worth to open a refactor issue for that?

@simobasso
Copy link
Copy Markdown
Member Author

Sure @glumia! Feel free to open an issue on this!

@simobasso simobasso added the bug This issue/PR relates to a bug. label Apr 26, 2021
@simobasso simobasso merged commit 70a29d3 into cookiecutter:master Apr 29, 2021
@simobasso simobasso mentioned this pull request May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This issue/PR relates to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Key error when using nested configuration files. [user config] exception with nested structures in default context

3 participants