Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

tests/test_shortcuts: Fix check for success on submit_results return #174

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

katieworton
Copy link
Member

Since submit_results now returns two values (success and testrun ID), the test_basic for submit_results needs to be updated to reflect this, otherwise the assertion will always return True.

Since submit_results now returns two values (success and testrun ID),
the test_basic for submit_results needs to be updated to reflect this,
otherwise the assertion will always return True.

Signed-off-by: Katie Worton <[email protected]>
@katieworton
Copy link
Member Author

@chaws just noticed a small change I missed with the unit test updates for changes to submit_results.

@chaws
Copy link
Collaborator

chaws commented Nov 14, 2023

Good catch!

Just for future references, the test still managed to go through even when submit_results returned two values, instead of a single value. It turns out that when you invoke self.assertTrue(arg), it's the same as saying bool(arg) is True.

In [1]: bool(False) # would've caught test failures
Out[1]: False

In [2]: bool((False, "test-run-id")) # Python evaluates non-empty tuples as true, thus masking `False`
Out[2]: True

@chaws chaws merged commit 34b59ae into Linaro:master Nov 14, 2023
2 of 4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants