[x] Have you followed the guidelines in our Contributing document, including the instructions about commit messages?
[ ] Is this PR to correct an issue?
[ ] Is this PR an enhancement?
Complete Description of Additions/Changes:
Using run_test with expected parameter DOES NOT perform expected assertion if expected value evaluates to false. For example, if expected is an empty list or dict or str or a bool value of False. The result is that no assertion is performed meaning that when checking that an integration test for a condition, for example, returns False but it instead, in error, returns True, run_test does not perform the assertion giving the impression that the test passes even though it does not.
This change fixes this by using a default sentinel value for expected and always performing the assertion unless expected is the sentinel value.
This change required updating an existing integration test. Additionally, it is important to note that this change will result in existing integration tests to fail which have fallen victim to this bug as well as any calls to run_test that explicitly pass expected=None thinking that it should mean do not perform any assertions.
All Pull Requests:
Check all that apply:
Complete Description of Additions/Changes:
Using
run_test
withexpected
parameter DOES NOT perform expected assertion ifexpected
value evaluates to false. For example, ifexpected
is an empty list or dict or str or a bool value ofFalse
. The result is that no assertion is performed meaning that when checking that an integration test for acondition
, for example, returnsFalse
but it instead, in error, returnsTrue
,run_test
does not perform the assertion giving the impression that the test passes even though it does not.This change fixes this by using a default sentinel value for
expected
and always performing the assertion unlessexpected
is the sentinel value.This change required updating an existing integration test. Additionally, it is important to note that this change will result in existing integration tests to fail which have fallen victim to this bug as well as any calls to
run_test
that explicitly passexpected=None
thinking that it should mean do not perform any assertions.