Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevate warning to errors for unknown attributes #788

Merged
merged 5 commits into from
Dec 31, 2023
Merged

Elevate warning to errors for unknown attributes #788

merged 5 commits into from
Dec 31, 2023

Conversation

filimarc
Copy link
Contributor

Describe the work done

Replace ConfigureWarning with ConfigureError for unknown attributes

List which issues this resolves:

closes #787

Tasks

  • Added tests
  • Updated documentation

Copy link
Contributor

@Helveg Helveg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also have to update the tests to reflect the change. Some test cases that should be covered:

  • Setting an attribute
  • Raise an error when setting an unknown attribute is set
  • Raise an error when trying to set a readonly attribute

bsb/config/_make.py Outdated Show resolved Hide resolved
@filimarc filimarc marked this pull request as ready for review December 20, 2023 14:17
@filimarc filimarc requested a review from Helveg December 20, 2023 14:17
Copy link
Contributor

@Helveg Helveg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Check the removed test
  • Add a test that triggers the readonly property error

tests/test_configuration.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Helveg Helveg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Use the appropriate assertIn idiom for the new test and we're done :)

tests/test_configuration.py Outdated Show resolved Hide resolved
@Helveg Helveg merged commit b0714eb into main Dec 31, 2023
10 checks passed
@Helveg Helveg deleted the cfg-AttrWarn branch January 5, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elevate unknown configuration attributes to errors
2 participants