Skip to content

test(evaluators): cover IsEmpty and IsNotEmpty on 0, False and whitespace - #409

Merged
refeed merged 1 commit into
StackGuardian:mainfrom
AK-Lmn:test/is-empty-evaluator-edge-cases
Oct 21, 2026
Merged

refeed merged 1 commit into
StackGuardian:mainfrom
AK-Lmn:test/is-empty-evaluator-edge-cases

Conversation

@AK-Lmn

@AK-Lmn AK-Lmn commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Closes #407

Description

Adds test coverage for falsy but non-empty values across IsEmpty and IsNotEmpty:

  • and False evaluate as non-empty in IsEmpty ({"passed": False, "message": "... is not empty"}), and as failing in IsNotEmpty ({"passed": False, "message": "... is empty"}).
  • " " (whitespace string) and {"a": None} (dict with a null value) evaluate as non-empty in IsEmpty (failing), and as not empty in IsNotEmpty (passing).

Changes

  • ** ests/core/evaluators/test_is_empty.py**:
    • Added , False, " ", and {"a": None} to checks_failing.
    • Updated @mark.failing marker on est_evaluate_failing.
  • ** ests/core/evaluators/test_is_not_empty.py**:
    • Parametrized with checks_passing = ("abc", " ", {"a": None}) and checks_failing = ("", 0, False).
    • Properly separated est_evaluate_passing and est_evaluate_failing functions.

Verification

  • pytest tests/core/evaluators/test_is_empty.py tests/core/evaluators/test_is_not_empty.py: 18/18 passed.
  • pytest tests/core/evaluators/: 223/223 passed.
  • �lack --line-length 120 --check: formatted and compliant.

…pace

Add 0, False, ' ', and {'a': None} to parametrized cases in test_is_empty.py and test_is_not_empty.py to pin evaluator behavior on falsy non-empty values.

Closes StackGuardian#407

Signed-off-by: kclamano <klamano23@gmail.com>
@refeed

refeed commented Oct 16, 2026

Copy link
Copy Markdown
Member

Hi @AK-Lmn , thanks for the PR, could you ask for assignee in the issue first so that I can assign you? (I can't assign you automatically because you're a new contributor)

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AK-Lmn

AK-Lmn commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @refeed! I've left a comment on #407 requesting assignment.

@refeed
refeed merged commit b1c564c into StackGuardian:main Oct 21, 2026
9 checks passed
@refeed

refeed commented Oct 21, 2026

Copy link
Copy Markdown
Member

Thank you @AK-Lmn :) !

@refeed

refeed commented Oct 21, 2026

Copy link
Copy Markdown
Member

Thank you so much for this contribution @AK-Lmn!💙 We truly value the time and care you put into improving Tirith, and it means a lot to see the community help shape it. If you’re sharing your work on LinkedIn, don’t forget to tag StackGuardian so we can cheer you on! Keep them coming. We’re excited to see what you build next 😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(evaluators): IsEmpty and IsNotEmpty on 0, False and whitespace

2 participants