StackGuardian / StackGuardian/tirith
In `test_contained_in` and other tests, assert more data instead of just the `passed` key
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 165
- Forks
- 42
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 11
Description
Is your feature request related to a problem? Please describe.
Not related to functionalities of the program, only to make the testcases more robust and reliable.
Describe the solution you'd like
Most of the test cases only assert the passed key and not all of the key, it's best to actually assert most of the keys available so that we know between evaluation that is actually failing or is not evaluated.
One example of this would be in test_contained_in
@mark.passing
@mark.parametrize("evaluator_input,evaluator_data", checks_passing)
def test_evaluate_passing(evaluator_input, evaluator_data):
result = evaluator.evaluate(evaluator_input, evaluator_data)
assert result["passed"] == True # {"passed": True, "message": f"Found {evaluator_input} inside {evaluator_data}"}
We have to at least assert as well the message key.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating test_contained_in and the test_evaluate_passing case shown in the issue, then inspect the evaluator results and checks_passing data used there. Extend the assertions beyond passed, including message and other keys exposed by the test data, and run the affected tests to confirm failures distinguish evaluation from assertion problems.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100