Skip to content

Reject booleans for numeric configuration fields - #16

Open
sylvesterkaczmarek wants to merge 1 commit into
esa:mainfrom
sylvesterkaczmarek:fix/reject-bool-numeric-config
Open

Reject booleans for numeric configuration fields#16
sylvesterkaczmarek wants to merge 1 commit into
esa:mainfrom
sylvesterkaczmarek:fix/reject-bool-numeric-config

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #15.

Python booleans are subclasses of int, so the generic numeric validators accepted True for fields such as max_workers and padding_factor.

Reject booleans explicitly in both integer and numeric validation while preserving the existing error messages.

Validation:

  • pytest tests/cutana/unit/test_validate_config.py -q — 49 passed
  • pytest tests/cutana/unit -q — 531 passed, 6 skipped
  • ruff check cutana/validate_config.py tests/cutana/unit/test_validate_config.py
  • ruff format --check cutana/validate_config.py tests/cutana/unit/test_validate_config.py
  • git diff --check

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.

Reject booleans for numeric configuration fields

1 participant